[Mono-bugs] [Bug 56452][Wis] Changed - extern method with no impl does not give error

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 4 Apr 2004 11:29:14 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=56452

--- shadow/56452	2004-04-04 11:25:03.000000000 -0400
+++ shadow/56452.tmp.27732	2004-04-04 11:29:14.000000000 -0400
@@ -60,6 +60,25 @@
 The issue is that an `extern' implementation, unlike in C, requires
 some sort of hint as to what the impl is. An example is the DllImport
 attribute. If no such specification is given, it is a compile time error.
 
 There is probably a spec quote i could give...but dont know where i
 would find it.
+
+------- Additional Comments From bmaurer@users.sf.net  2004-04-04 11:29 -------
+C:\Inetpub\ftproot>csc tt.cs
+tt.cs(2,21): warning CS0626: Method, operator, or accessor
+        'Test.does_not_work()' is marked external and has no
+attributes on it.
+        Consider adding a DllImport attribute to specify the external
+        implementation
+ 
+C:\Inetpub\ftproot>tt
+ 
+Unhandled Exception: System.TypeLoadException: Could not load type
+Test from assembly tt, Version=0.0.0.0, Culture=neutral,
+PublicKeyToken=null because the method does_not_work has no RVA.
+
+So, it is actually an mcs warning, and mono should really throw a
+typeloadexception. I know we dont throw most of the loading
+exceptions, but for something like this,i would at least expect a nice
+error message.