Skip to content
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

Referencing assembly with improper use of TypeSpec compiles but does not run #7970

Closed
nguerrera opened this issue Jan 14, 2016 · 1 comment
Closed
Assignees
Labels
Area-Compilers Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@nguerrera
Copy link
Contributor

There is an issue in the ECMA-335 CLI specification where it is implied that (CLASS | VALUETYPE) can be followed by a TypeSpec token, when in fact only TypeRef and TypeDef are valid. When referencing a bad assembly that has such a signature, Roslyn recurses into the TypeSpec. It then emits the signature in the proper way, with the TypeSpec contents embedded into the MemberRef 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

  • compilation succeeds without warnings
  • run fails
System.MissingMethodException: Method not found:  
    'Void User.X(System.Collections.Generic.List`1<Int32>)'.

Native csc

  • compilation fails as expected:
UseTypeSpecInWrongPlace.cs(19,9): error CS0570: 'X' is not supported by the language

cc @tmat @gafter @AlekseyTs

@gafter
Copy link
Member

gafter commented Jan 15, 2016

/cc @jaredpar

@tmat tmat self-assigned this Jan 19, 2016
@tmat tmat added this to the 1.2 milestone Jan 19, 2016
@tmat tmat modified the milestones: 1.3, 1.2 Feb 1, 2016
@tmat tmat closed this as completed Feb 1, 2016
@tmat tmat added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Feb 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants