Bug 60243 - mcs compiles a vararg method on a generic instance; should be CS0224
Summary: mcs compiles a vararg method on a generic instance; should be CS0224
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2017-10-17 22:04 UTC by Aleksey Kliger
Modified: 2017-10-26 15:00 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
VarArgsSimpl.cs (666 bytes, text/plain)
2017-10-17 22:04 UTC, Aleksey Kliger
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 60243 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Aleksey Kliger 2017-10-17 22:04:52 UTC
Created attachment 25346 [details]
VarArgsSimpl.cs

$ mcs VarArgsSimpl.cs
$ mono VarArgsSimpl.exe

Unhandled Exception:
System.BadImageFormatException: Method with open type while not compiling gshared
File name: 'VarArgsSimpl'
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Method with open type while not compiling gshared
File name: 'VarArgsSimpl'
Comment 1 Zoltan Varga 2017-10-26 14:25:59 UTC
This is not valid c#, csc refuses to compile it:

Microsoft (R) Visual C# Compiler version 2.3.1.61919 (57c81319)
Copyright (C) Microsoft Corporation. All rights reserved.

bugg.cs(4,21): error CS0224: A method with vararg cannot be generic, be in a generic type, or have a params parameter