diff --git a/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs b/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs index 280511da0f..b038a84802 100644 --- a/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs +++ b/ICSharpCode.NRefactory.CSharp/Ast/SimpleType.cs @@ -42,6 +42,11 @@ namespace ICSharpCode.NRefactory.CSharp this.Identifier = identifier; } + public SimpleType (Identifier identifier) + { + this.IdentifierToken = identifier; + } + public SimpleType(string identifier, TextLocation location) { SetChildByRole (Roles.Identifier, CSharp.Identifier.Create (identifier, location)); diff --git a/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs b/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs index e9a52f8da0..574ad66bdd 100644 --- a/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs +++ b/ICSharpCode.NRefactory.CSharp/Parser/CSharpParser.cs @@ -2414,7 +2414,7 @@ namespace ICSharpCode.NRefactory.CSharp var location = LocationsBag.GetLocations (c); var constraint = new Constraint (); constraint.AddChild (new CSharpTokenNode (Convert (c.Location), "where".Length), InvocationExpression.Roles.Keyword); - constraint.AddChild (Identifier.Create (c.TypeParameter.Value, Convert (c.TypeParameter.Location)), InvocationExpression.Roles.Identifier); + constraint.AddChild (new SimpleType (Identifier.Create (c.TypeParameter.Value, Convert (c.TypeParameter.Location))), Constraint.BaseTypeRole); if (location != null) constraint.AddChild (new CSharpTokenNode (Convert (location [0]), 1), Constraint.ColonRole); var commaLocs = LocationsBag.GetLocations (c.ConstraintExpressions);