Browse Source

[Resolver] Fixed unexpected resolver crash.

Test Case:
Action foo = f => { f.FirstOrDefault(l=>); };
newNRvisualizers
Mike Krüger 13 years ago
parent
commit
ae20e4929a
  1. 7
      ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs

7
ICSharpCode.NRefactory.CSharp/Resolver/ResolveVisitor.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
@ -2525,6 +2525,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver @@ -2525,6 +2525,11 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
Log.Indent();
while (undecidedLambdas.Count > 0) {
LambdaBase lambda = undecidedLambdas[0];
// may happen caused by parse error l =>
if (lambda.LambdaExpression == null) {
undecidedLambdas.Remove (lambda);
continue;
}
ResolveParentForConversion(lambda.LambdaExpression);
if (lambda.IsUndecided) {
// Lambda wasn't merged by resolving its parent -> enforce merging

Loading…
Cancel
Save