Referencing assembly with improper use of TypeSpec compiles but does not run #7970
Labels
Area-Compilers
Bug
Resolution-Fixed
The bug has been fixed and/or the requested behavior has been implemented
Milestone
There is an issue in the ECMA-335 CLI specification where it is implied that
(CLASS | VALUETYPE)
can be followed by aTypeSpec
token, when in fact onlyTypeRef
andTypeDef
are valid. When referencing a bad assembly that has such a signature, Roslyn recurses into theTypeSpec
. It then emits the signature in the proper way, with theTypeSpec
contents embedded into theMemberRef
signature, but the call cannot bind to the bad method at runtime.I have started to document such spec issues in dotnet/corefx#5435 and I'm now filing the bugs I found while experimenting to write that up.
Native csc.exe produced an error at compilation time.
Repro steps
Expected result
Compilation fails with suitable error message.
Actual result
Roslyn
Native csc
cc @tmat @gafter @AlekseyTs
The text was updated successfully, but these errors were encountered: