diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-02-02 13:04:44 +0300 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-02-02 13:04:44 +0300 |
commit | 9c18044b3da30f32f935620f70712fed1b322a18 (patch) | |
tree | 0248933b93bab0f87cac0a8baedbde93e2bc6e54 /mcs/errors/cs0108-12.cs | |
parent | 4fac661442e203c01a47367f6d6ca20f622fc41a (diff) |
Fix a crasher in a variant of #31984.
* mcs/const.cs (Constant.CheckBase): New override that defers the
new-or-override check in case the base type hasn't been populated yet.
(Constant.Define): Ensure the new-or-override check is performed.
* tests/test-341.cs: Update to reflect fix of compiler crash.
* errors/cs0108-12.cs: New test. Ensure that cs0108 handling occurs when
a constant is defined ahead of time due to forward references.
svn path=/trunk/mcs/; revision=39971
Diffstat (limited to 'mcs/errors/cs0108-12.cs')
-rw-r--r-- | mcs/errors/cs0108-12.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mcs/errors/cs0108-12.cs b/mcs/errors/cs0108-12.cs new file mode 100644 index 00000000000..cfb5e9b6d02 --- /dev/null +++ b/mcs/errors/cs0108-12.cs @@ -0,0 +1,22 @@ +// cs0108-12.cs: The keyword new is required on 'Libs.MyLib' because it hides inherited member +// Line: 18 +// Compiler options: -warnaserror -warn:1 + +using System; +using System.Runtime.InteropServices; + +class Test { + [DllImport (Libs.MyLib)] + private static extern void foo (); + + public static void Main () + { + } +} + +class Libs : Foo { + internal const string MyLib = "SomeLibrary"; +} +class Foo { + internal const string MyLib = "Foo"; +} |