Skip to content

Commit

Permalink
fix old test, address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TyOverby committed May 10, 2017
1 parent a6a0f43 commit 229e33e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/Compilers/CSharp/Portable/Compiler/MethodCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ private static MethodSymbol GetEntryPoint(CSharpCompilation compilation, PEModul
BoundStatement body = synthesizedEntryPoint.CreateBody();

var dynamicAnalysisSpans = ImmutableArray<SourceSpan>.Empty;
var diagsForCurrentMethod = DiagnosticBag.GetInstance();
VariableSlotAllocator lazyVariableSlotAllocator = null;
var lambdaDebugInfoBuilder = ArrayBuilder<LambdaDebugInfo>.GetInstance();
var closureDebugInfoBuilder = ArrayBuilder<ClosureDebugInfo>.GetInstance();
Expand All @@ -240,7 +239,7 @@ private static MethodSymbol GetEntryPoint(CSharpCompilation compilation, PEModul
false ,
null,
ref dynamicAnalysisSpans,
diagsForCurrentMethod,
diagnostics,
ref lazyVariableSlotAllocator,
lambdaDebugInfoBuilder,
closureDebugInfoBuilder,
Expand All @@ -252,6 +251,9 @@ private static MethodSymbol GetEntryPoint(CSharpCompilation compilation, PEModul
Debug.Assert(lambdaDebugInfoBuilder.IsEmpty());
Debug.Assert(closureDebugInfoBuilder.IsEmpty());

lambdaDebugInfoBuilder.Free();
closureDebugInfoBuilder.Free();

var emittedBody = GenerateMethodBody(
moduleBeingBuilt,
synthesizedEntryPoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3434,11 +3434,9 @@ async public static Task Main()
// (5,30): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
// async public static Task Main()
Diagnostic(ErrorCode.WRN_AsyncLacksAwaits, "Main").WithLocation(5, 30),
// (5,5): error CS8107: Feature 'async main' is not available in C# 7. Please use language version 7.1 or greater.
// (5,25): error CS8107: Feature 'async main' is not available in C# 7. Please use language version 7.1 or greater.
// async public static Task Main()
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7, @"async public static Task Main()
{
}").WithArguments("async main", "7.1").WithLocation(5, 5),
Diagnostic(ErrorCode.ERR_FeatureNotAvailableInVersion7, "Task").WithArguments("async main", "7.1").WithLocation(5, 25),
// error CS5001: Program does not contain a static 'Main' method suitable for an entry point
Diagnostic(ErrorCode.ERR_NoEntryPoint).WithLocation(1, 1));
}
Expand Down

0 comments on commit 229e33e

Please sign in to comment.