提交 55884010 编写于 作者: J Jonathon Marolf

Merge pull request #6921 from jmarolf/GenerateConstructorCrash

Fix crash in generate constructor for C#
Fixes #6920
......@@ -757,5 +757,13 @@ public Derived(int a, string value = null) : base(a, value)
}
}");
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateConstructor)]
public void TestGenerateWithIncorrectConstructorArguments_Crash()
{
Test(
@"using System ; using System . Collections . Generic ; using System . Linq ; using System . Threading . Tasks ; abstract class Y { class X : Y { void M ( ) { new X ( new [|string|] ( ) ) ; } } } ",
@"using System ; using System . Collections . Generic ; using System . Linq ; using System . Threading . Tasks ; abstract class Y { class X : Y { private string v ; public X ( string v ) { this . v = v ; } void M ( ) { new X ( new string ( ) ) ; } } } ");
}
}
}
......@@ -57,7 +57,7 @@ private static bool ParameterTypesMatch(SemanticDocument document, IList<ITypeSy
return false;
}
if (parameterTypes.Count < method.Parameters.Length)
if (parameterTypes.Count != method.Parameters.Length)
{
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册