The resolver does not validate constraints when constructing a generic type #95
Labels
No labels
Bug
Feature Request
NR6Pack
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/NRefactory#95
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Failing test:
I'm not sure if the resolver should attempt to discover this type of error - this might make more sense in an issue provider.
You can use the static
OverloadResolution.ValidateConstraintsmethod to test the constraints yourself.Actually, I do not care. I just reported the issue because the resolver does validate constraints on method invocation, making me think it is inconsistent to not do it when invoking a constructor.
But the constructor invocation isn't really the right place to report this error - it would be better reported directly on the
AstTypewithin the constructor invocation.Wouldn't a good model in that case be that the AstType resolves to a TypeResolveResult with an error?