-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check duplicate interfaces only for metadata #73797
Check duplicate interfaces only for metadata #73797
Conversation
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
Done with review pass (commit 2) |
Done with review pass (commit 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 4)
@RikkiGibson for another look, thanks |
public interface I<T> { } | ||
"""; | ||
|
||
CompileAndVerify(CreateCompilationWithMscorlib40(source), symbolValidator: validate).VerifyDiagnostics(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is interesting to also know what the source symbol does. Is it going to have interface I<T>
twice with different nullability?
|
||
partial class C1<T> : I< | ||
T, | ||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would also be interesting to test when the lexical first declaration has a nullable-disabled type argument
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for minor test quibbles. No need to comprehensively change tests to address them, even just one example of each would be great.
@RikkiGibson for another look, thanks |
var interfaces = c.AllInterfacesNoUseSiteDiagnostics; | ||
Assert.Equal(2, interfaces.Length); | ||
AssertEx.Equal("I<T>", interfaces[0].ToTestDisplayString(includeNonNullable: true)); | ||
AssertEx.Equal("I<T>", interfaces[1].ToTestDisplayString(includeNonNullable: true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that these actually have exactly the same type? If not, consider adjusting the comparison so that the distinction between the two types are clear.
Fixes #40538.
Fixes dotnet/razor#9837.
First commit extracted out of #73730.