[svn] r7037: nemerle/trunk/ncc: external/InternalTypes.n
testsuite/negative/void-parm.n typing/TyVarEnv.n
nazgul
svnadmin at nemerle.org
Sun Dec 3 23:19:00 CET 2006
Log:
Bind System.Void as MType.Void, with help from patch by Evin Robertson
Author: nazgul
Date: Sun Dec 3 23:18:56 2006
New Revision: 7037
Modified:
nemerle/trunk/ncc/external/InternalTypes.n
nemerle/trunk/ncc/testsuite/negative/void-parm.n
nemerle/trunk/ncc/typing/TyVarEnv.n
Modified: nemerle/trunk/ncc/external/InternalTypes.n
==============================================================================
--- nemerle/trunk/ncc/external/InternalTypes.n (original)
+++ nemerle/trunk/ncc/external/InternalTypes.n Sun Dec 3 23:18:56 2006
@@ -381,6 +381,7 @@
[ManagerAccess]
public class InternalTypeClass
{
+ public mutable Void_tc : TypeInfo;
public mutable Array_tc : TypeInfo;
public mutable Attribute_tc : TypeInfo;
public mutable Boolean_tc : TypeInfo;
@@ -566,7 +567,7 @@
(Int32_tc :> LibraryReference.NetType).AddBuiltins ();
// and here not
- Void = MType.Void ();
+ Void_tc = lookup ("System.Void"); Void = MType.Void();
Array_tc = lookup ("System.Array"); Array = MType.Class (Array_tc, []);
Attribute_tc = lookup ("System.Attribute"); Attribute = MType.Class (Attribute_tc, []);
Byte_tc = lookup ("System.Byte"); Byte = MType.Class (Byte_tc, []);
Modified: nemerle/trunk/ncc/testsuite/negative/void-parm.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/void-parm.n (original)
+++ nemerle/trunk/ncc/testsuite/negative/void-parm.n Sun Dec 3 23:18:56 2006
@@ -1,8 +1,26 @@
+public class A['a]
+{
+}
+
+public class B
+{
+ x : A[System.Void]; // E: cannot use `void' as a generic parameter
+
+ public F() : void
+ {
+
+ }
+}
+
module M {
public foo (_ : void) : void // E: has void argument
{
}
+ public bar (_ : System.Void) : void // E: has void argument
+ {
+ }
+
public Main () : void // OK
{
}
Modified: nemerle/trunk/ncc/typing/TyVarEnv.n
==============================================================================
--- nemerle/trunk/ncc/typing/TyVarEnv.n (original)
+++ nemerle/trunk/ncc/typing/TyVarEnv.n Sun Dec 3 23:18:56 2006
@@ -130,7 +130,8 @@
match (typeinfos) {
| [ti]
| _ when exact_hit != null with ti = exact_hit =>
- if (ti.TyparmsCount == args.Length)
+ if (ti.Equals (InternalType.Void_tc)) InternalType.Void
+ else if (ti.TyparmsCount == args.Length)
MType.Class (ti, args)
else {
def find_nesting (nesting : TypeInfo) {
More information about the svn
mailing list