diff --git a/src/Compilers/CSharp/Portable/LanguageVersion.cs b/src/Compilers/CSharp/Portable/LanguageVersion.cs index ed7b32f9b9e6ff30517188970840b83904c71da0..3b85ded0f2083c4dc70788cc780a68477083d218 100644 --- a/src/Compilers/CSharp/Portable/LanguageVersion.cs +++ b/src/Compilers/CSharp/Portable/LanguageVersion.cs @@ -340,6 +340,8 @@ public static LanguageVersion MapSpecifiedToEffectiveVersion(this LanguageVersio } } + internal static LanguageVersion CurrentVersion => LanguageVersion.CSharp8; + /// Inference of tuple element names was added in C# 7.1 internal static bool DisallowInferredTupleElementNames(this LanguageVersion self) { diff --git a/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.DebuggerSyntaxTree.cs b/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.DebuggerSyntaxTree.cs index 38cf097e4dad4f0e645054d5f1260d111caedb74..8b82f69e61cdb13dae463bff86417bbb66a31bbe 100644 --- a/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.DebuggerSyntaxTree.cs +++ b/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.DebuggerSyntaxTree.cs @@ -8,13 +8,13 @@ public partial class CSharpSyntaxTree { private class DebuggerSyntaxTree : ParsedSyntaxTree { - public DebuggerSyntaxTree(CSharpSyntaxNode root, SourceText text) + public DebuggerSyntaxTree(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options) : base( text, text.Encoding, text.ChecksumAlgorithm, path: "", - options: CSharpParseOptions.Default, + options: options, root: root, directives: Syntax.InternalSyntax.DirectiveStack.Empty) { diff --git a/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs b/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs index e98a32109868388ff0e3a9894c9954086fc5d4ce..7c26c1d6b259f50ca26705d9e06bef0e7564568a 100644 --- a/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs +++ b/src/Compilers/CSharp/Portable/Syntax/CSharpSyntaxTree.cs @@ -327,11 +327,11 @@ public static SyntaxTree Create(CSharpSyntaxNode root, CSharpParseOptions option /// Creates a new syntax tree from a syntax node with text that should correspond to the syntax node. /// /// This is used by the ExpressionEvaluator. - internal static SyntaxTree CreateForDebugger(CSharpSyntaxNode root, SourceText text) + internal static SyntaxTree CreateForDebugger(CSharpSyntaxNode root, SourceText text, CSharpParseOptions options) { Debug.Assert(root != null); - return new DebuggerSyntaxTree(root, text); + return new DebuggerSyntaxTree(root, text, options); } /// diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/CSharpParseOptionsTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/CSharpParseOptionsTests.cs index 8adb1dce63dab4fda0e6ab0fc306a83fb73289b8..2dae7e385a53e008fb0c30530182f4ae1fea4c64 100644 --- a/src/Compilers/CSharp/Test/Syntax/Parsing/CSharpParseOptionsTests.cs +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/CSharpParseOptionsTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Roslyn.Test.Utilities; using Xunit; diff --git a/src/Compilers/CSharp/Test/Syntax/Parsing/LanguageVersionTests.cs b/src/Compilers/CSharp/Test/Syntax/Parsing/LanguageVersionTests.cs new file mode 100644 index 0000000000000000000000000000000000000000..e00cbbc38b253d57a20cdccc4a5626bc4e831d86 --- /dev/null +++ b/src/Compilers/CSharp/Test/Syntax/Parsing/LanguageVersionTests.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using Xunit; + +namespace Microsoft.CodeAnalysis.CSharp.UnitTests +{ + public class LanguageVersionTests + { + [Fact] + public void CurrentVersion() + { + var highest = Enum. + GetValues(typeof(LanguageVersion)). + Cast(). + Where(x => x != LanguageVersion.Latest). + Max(); + + Assert.Equal(LanguageVersionFacts.CurrentVersion, highest); + } + } +} diff --git a/src/Compilers/VisualBasic/Portable/LanguageVersion.vb b/src/Compilers/VisualBasic/Portable/LanguageVersion.vb index 0941659c1d160644551fb41087352a8a0266b081..e9d68440ead01a6f947142336cbcd388ddd2bc0c 100644 --- a/src/Compilers/VisualBasic/Portable/LanguageVersion.vb +++ b/src/Compilers/VisualBasic/Portable/LanguageVersion.vb @@ -89,6 +89,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic End Select End Function + Friend ReadOnly Property CurrentVersion As LanguageVersion + Get + Return LanguageVersion.VisualBasic16 + End Get + End Property + ''' ''' Displays the version number in the format understood on the command-line (/langver flag). ''' For instance, "9", "15", "latest". diff --git a/src/Compilers/VisualBasic/Test/Syntax/Parser/LanguageVersionTests.vb b/src/Compilers/VisualBasic/Test/Syntax/Parser/LanguageVersionTests.vb new file mode 100644 index 0000000000000000000000000000000000000000..8c65f77c386a04b2e017f956cb68b3e81570191a --- /dev/null +++ b/src/Compilers/VisualBasic/Test/Syntax/Parser/LanguageVersionTests.vb @@ -0,0 +1,14 @@ +' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +Public Class LanguageVersionTests + + Public Sub CurrentVersion() + Dim highest = System.Enum. + GetValues(GetType(LanguageVersion)). + Cast(Of LanguageVersion). + Where(Function(x) x <> LanguageVersion.Latest). + Max() + + Assert.Equal(LanguageVersionFacts.CurrentVersion, highest) + End Sub +End Class diff --git a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/SyntaxHelpers.cs b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/SyntaxHelpers.cs index c2b18c72f8014f5bc3ccb80cb7ec62191fc75246..99674d9a657d4ed7eb8708880c8fbcd9f84b76aa 100644 --- a/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/SyntaxHelpers.cs +++ b/src/ExpressionEvaluator/CSharp/Source/ExpressionCompiler/SyntaxHelpers.cs @@ -13,6 +13,8 @@ namespace Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator { internal static class SyntaxHelpers { + internal static readonly CSharpParseOptions ParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersionFacts.CurrentVersion); + /// /// Parse expression. Returns null if there are any errors. /// @@ -195,11 +197,9 @@ private static ExpressionSyntax ParseDebuggerExpression(string text, bool consum return expression.MakeDebuggerExpression(source); } - static readonly CSharpParseOptions s_CSharpParseOptions = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest); - private static InternalSyntax.ExpressionSyntax ParseDebuggerExpressionInternal(SourceText source, bool consumeFullText) { - using (var lexer = new InternalSyntax.Lexer(source, s_CSharpParseOptions, allowPreprocessorDirectives: false)) + using (var lexer = new InternalSyntax.Lexer(source, ParseOptions, allowPreprocessorDirectives: false)) { using (var parser = new InternalSyntax.LanguageParser(lexer, oldTree: null, changes: null, lexerMode: InternalSyntax.LexerMode.DebuggerSyntax)) { @@ -213,7 +213,7 @@ private static InternalSyntax.ExpressionSyntax ParseDebuggerExpressionInternal(S private static StatementSyntax ParseDebuggerStatement(string text) { var source = SourceText.From(text); - using (var lexer = new InternalSyntax.Lexer(source, s_CSharpParseOptions)) + using (var lexer = new InternalSyntax.Lexer(source, ParseOptions)) { using (var parser = new InternalSyntax.LanguageParser(lexer, oldTree: null, changes: null, lexerMode: InternalSyntax.LexerMode.DebuggerSyntax)) { @@ -226,7 +226,7 @@ private static StatementSyntax ParseDebuggerStatement(string text) private static SyntaxTree CreateSyntaxTree(this InternalSyntax.CSharpSyntaxNode root, SourceText text) { - return CSharpSyntaxTree.CreateForDebugger((CSharpSyntaxNode)root.CreateRed(), text); + return CSharpSyntaxTree.CreateForDebugger((CSharpSyntaxNode)root.CreateRed(), text, ParseOptions); } private static ExpressionSyntax MakeDebuggerExpression(this InternalSyntax.ExpressionSyntax expression, SourceText text) diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs index 8b9554aea356ec090e4adac9969a3ef58fa262f3..b01d8c29f79c286d07ed685ea6f8a4846d5fadbe 100644 --- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs +++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTestBase.cs @@ -304,10 +304,9 @@ internal static (Guid ModuleVersionId, ISymUnmanagedReader SymReader, int Method string methodName, string expr, int atLineNumber = -1, - bool includeSymbols = true, - LanguageVersion langVersion = LanguageVersion.Default) + bool includeSymbols = true) { - var result = Evaluate(source, outputKind, methodName, expr, out _, out string error, atLineNumber, includeSymbols, langVersion); + var result = Evaluate(source, outputKind, methodName, expr, out _, out string error, atLineNumber, includeSymbols); Assert.Null(error); return result; } @@ -332,12 +331,11 @@ internal static (Guid ModuleVersionId, ISymUnmanagedReader SymReader, int Method out ResultProperties resultProperties, out string error, int atLineNumber = -1, - bool includeSymbols = true, - LanguageVersion langVersion = LanguageVersion.Default) + bool includeSymbols = true) { var compilation = CreateCompilation( source, - parseOptions: CSharpParseOptions.Default.WithLanguageVersion(langVersion), + parseOptions: SyntaxHelpers.ParseOptions, options: (outputKind == OutputKind.DynamicallyLinkedLibrary) ? TestOptions.DebugDll : TestOptions.DebugExe); return Evaluate(compilation, methodName, expr, out resultProperties, out error, atLineNumber, includeSymbols); diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTests.cs b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTests.cs index f79f503f7f0bc98b9133361cfac28a40f58b799f..e9b5621328b65320ba853b764a72908b1e1ffac3 100644 --- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTests.cs +++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ExpressionCompilerTests.cs @@ -6685,8 +6685,7 @@ .locals init (System.Guid V_0) }"); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/30436")] - [WorkItem(30436, "https://github.com/dotnet/roslyn/issues/30436")] + [Fact] public void IndexExpression() { var source = TestSources.Index + @" @@ -6697,8 +6696,7 @@ static void Main() var x = ^1; } }"; - var langVersion = LanguageVersion.CSharp8; - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 2 (0x2) .maxstack 1 @@ -6707,7 +6705,7 @@ .maxstack 1 IL_0001: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Value", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Value").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 8 (0x8) .maxstack 1 @@ -6717,7 +6715,7 @@ .maxstack 1 IL_0007: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "^2", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "^2").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 8 (0x8) .maxstack 2 @@ -6729,8 +6727,7 @@ .maxstack 2 }"); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/30436")] - [WorkItem(30436, "https://github.com/dotnet/roslyn/issues/30436")] + [Fact] public void RangeExpression_None() { var source = TestSources.Index + TestSources.Range + @" @@ -6741,8 +6738,7 @@ static void Main() var x = ..; } }"; - var langVersion = LanguageVersion.CSharp8; - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 2 (0x2) .maxstack 1 @@ -6751,7 +6747,7 @@ .maxstack 1 IL_0001: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 16 (0x10) .maxstack 1 @@ -6765,7 +6761,7 @@ .maxstack 1 IL_000f: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "..", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "..").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 6 (0x6) .maxstack 1 @@ -6775,8 +6771,7 @@ .maxstack 1 }"); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/30436")] - [WorkItem(30436, "https://github.com/dotnet/roslyn/issues/30436")] + [Fact] public void RangeExpression_Left() { var source = TestSources.Index + TestSources.Range + @" @@ -6787,8 +6782,7 @@ static void Main() var x = 1..; } }"; - var langVersion = LanguageVersion.CSharp8; - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 2 (0x2) .maxstack 1 @@ -6797,7 +6791,7 @@ .maxstack 1 IL_0001: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 16 (0x10) .maxstack 1 @@ -6811,7 +6805,7 @@ .maxstack 1 IL_000f: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "2..", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "2..").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 12 (0xc) .maxstack 1 @@ -6823,8 +6817,7 @@ .maxstack 1 }"); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/30436")] - [WorkItem(30436, "https://github.com/dotnet/roslyn/issues/30436")] + [Fact] public void RangeExpression_Right() { var source = TestSources.Index + TestSources.Range + @" @@ -6835,8 +6828,7 @@ static void Main() var x = ..1; } }"; - var langVersion = LanguageVersion.CSharp8; - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 2 (0x2) .maxstack 1 @@ -6845,7 +6837,7 @@ .maxstack 1 IL_0001: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 16 (0x10) .maxstack 1 @@ -6859,7 +6851,7 @@ .maxstack 1 IL_000f: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "..2", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "..2").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 12 (0xc) .maxstack 1 @@ -6871,8 +6863,7 @@ .maxstack 1 }"); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/30436")] - [WorkItem(30436, "https://github.com/dotnet/roslyn/issues/30436")] + [Fact] public void RangeExpression_Both() { var source = TestSources.Index + TestSources.Range + @" @@ -6883,8 +6874,7 @@ static void Main() var x = 1..2; } }"; - var langVersion = LanguageVersion.CSharp8; - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 2 (0x2) .maxstack 1 @@ -6893,7 +6883,7 @@ .maxstack 1 IL_0001: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "x.Start.Value").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 16 (0x10) .maxstack 1 @@ -6907,7 +6897,7 @@ .maxstack 1 IL_000f: ret }"); - Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "3..4", langVersion: langVersion).GetMethodData("<>x.<>m0").VerifyIL( + Evaluate(source, OutputKind.ConsoleApplication, "C.Main", "3..4").GetMethodData("<>x.<>m0").VerifyIL( @"{ // Code size 18 (0x12) .maxstack 2 diff --git a/src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/SyntaxHelpers.vb b/src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/SyntaxHelpers.vb index 93f27b31b4490d51cb7e7866b52d95c1fbab42e2..76ec7a07ec8b071f29ca31c6d48de1eef1588500 100644 --- a/src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/SyntaxHelpers.vb +++ b/src/ExpressionEvaluator/VisualBasic/Source/ExpressionCompiler/SyntaxHelpers.vb @@ -10,6 +10,8 @@ Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator Friend Module SyntaxHelpers + Friend ReadOnly ParseOptions As VisualBasicParseOptions = VisualBasicParseOptions.Default.WithLanguageVersion(LanguageVersionFacts.CurrentVersion) + ''' ''' Parse expression. Returns null if there are any errors. ''' @@ -152,7 +154,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator End Function Private Function ParseDebuggerExpressionInternal(source As SourceText, consumeFullText As Boolean) As InternalSyntax.ExpressionSyntax - Using scanner As New InternalSyntax.Scanner(source, VisualBasicParseOptions.Default, isScanningForExpressionCompiler:=True) ' NOTE: Default options should be enough + Using scanner As New InternalSyntax.Scanner(source, ParseOptions, isScanningForExpressionCompiler:=True) ' NOTE: Default options should be enough Using p = New InternalSyntax.Parser(scanner) p.GetNextToken() Dim node = p.ParseExpression() @@ -163,7 +165,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator End Function Private Function ParseDebuggerStatement(text As String) As StatementSyntax - Using scanner As New InternalSyntax.Scanner(SourceText.From(text), VisualBasicParseOptions.Default, isScanningForExpressionCompiler:=True) ' NOTE: Default options should be enough + Using scanner As New InternalSyntax.Scanner(SourceText.From(text), ParseOptions, isScanningForExpressionCompiler:=True) ' NOTE: Default options should be enough Using p = New InternalSyntax.Parser(scanner) p.GetNextToken() Dim node = p.ParseStatementInMethodBody() @@ -176,7 +178,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator Private Function CreateSyntaxTree(root As InternalSyntax.VisualBasicSyntaxNode) As SyntaxTree - Return VisualBasicSyntaxTree.Create(DirectCast(root.CreateRed(Nothing, 0), VisualBasicSyntaxNode)) + Return VisualBasicSyntaxTree.Create(DirectCast(root.CreateRed(Nothing, 0), VisualBasicSyntaxNode), ParseOptions) End Function diff --git a/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb b/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb index 3c5cf0812e2d5207adfdb48e4689308c03a4f255..4efcaf90403c47c99ab073fa159133ab41fe915e 100644 --- a/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb +++ b/src/ExpressionEvaluator/VisualBasic/Test/ExpressionCompiler/ExpressionCompilerTestBase.vb @@ -317,7 +317,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.UnitTests Optional includeSymbols As Boolean = True) As CompilationTestData Dim compilation0 = CreateEmptyCompilationWithReferences( - {Parse(source)}, + {Parse(source, SyntaxHelpers.ParseOptions)}, {MscorlibRef_v4_0_30316_17626, SystemRef, MsvbRef}, options:=If(outputKind = OutputKind.DynamicallyLinkedLibrary, TestOptions.DebugDll, TestOptions.DebugExe))