Perform language version check for an implicit implementation of a static virtual member#61601
Perform language version check for an implicit implementation of a static virtual member#61601AlekseyTs merged 2 commits intodotnet:mainfrom
Conversation
…atic virtual member Fixes dotnet#61598.
| GetInterfaceLocation(interfaceMember, implementingType), | ||
| implicitImpl, interfaceMember, implementingType); | ||
| LanguageVersion requiredVersion = MessageID.IDS_FeatureStaticAbstractMembersInInterfaces.RequiredVersion(); | ||
| LanguageVersion? availableVersion = implementingType.DeclaringCompilation?.LanguageVersion; |
There was a problem hiding this comment.
In which scenarios does the implementing type lack a declaring compilation? Maybe only in EE? #Resolved
There was a problem hiding this comment.
In which scenarios does the implementing type lack a declaring compilation? Maybe only in EE?
Types not declared in source do not have declaring compilation
There was a problem hiding this comment.
I didn't realize that these checks could occur when the implementing type isn't declared in source. Could you please point out a test where the implementing type is not declared in source?
There was a problem hiding this comment.
I didn't realize that these checks could occur when the implementing type isn't declared in source. Could you please point out a test where the implementing type is not declared in source?
The FindImplementationForInterfaceMember API can be called on any type and it might potentially get here for a type that is not declared is source. I don't think I specifically test for a diagnostics like this in those cases because the diagnostics is simply getting dropped, even if reported. StaticAbstractMembersInInterfacesTests call FindImplementationForInterfaceMember API in various scenarios for source and non-source symbols, as well as other tests utilizing the API.
There was a problem hiding this comment.
That makes complete sense, thanks.
|
@333fred, @dotnet/roslyn-compiler For the second review |
Fixes #61598.