[svn] r7426: nemerle/trunk/ncc: testsuite/negative/cyclic.n
testsuite/positive/typeof.n typing/MType.n typ...
nazgul
svnadmin at nemerle.org
Wed Feb 14 21:13:45 CET 2007
Log:
Fix 899 and failing tests
Author: nazgul
Date: Wed Feb 14 21:13:36 2007
New Revision: 7426
Modified:
nemerle/trunk/ncc/testsuite/negative/cyclic.n
nemerle/trunk/ncc/testsuite/positive/typeof.n
nemerle/trunk/ncc/typing/MType.n
nemerle/trunk/ncc/typing/Typer.n
Modified: nemerle/trunk/ncc/testsuite/negative/cyclic.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/negative/cyclic.n (original)
+++ nemerle/trunk/ncc/testsuite/negative/cyclic.n Wed Feb 14 21:13:36 2007
@@ -6,8 +6,7 @@
}
public class X[A, // E: A constraint of 'A' type parameter is cyclic \(A => B => C => A\)
- B, // E: A constraint of 'B' type parameter is cyclic \(B => C => A => B\)
- C, D, E] // E: A constraint of 'C' type parameter is cyclic \(C => A => B => C\)
+ B, C, D, E]
where A: B
where B: C
Modified: nemerle/trunk/ncc/testsuite/positive/typeof.n
==============================================================================
--- nemerle/trunk/ncc/testsuite/positive/typeof.n (original)
+++ nemerle/trunk/ncc/testsuite/positive/typeof.n Wed Feb 14 21:13:36 2007
@@ -79,7 +79,8 @@
System.Console.WriteLine (typeof (System.Collections.Generic.List[_]));
System.Console.WriteLine (typeof (System.Collections.Generic.Dictionary[_,_]));
System.Console.WriteLine (typeof (System.Collections.Generic.List[int]));
-
+ System.Console.WriteLine(typeof(_ * _).IsGenericTypeDefinition);
+ System.Console.WriteLine(typeof(_ * _).Equals(typeof(object * object)));
System.Console.WriteLine (Bug676.D());
}
@@ -92,6 +93,8 @@
System.Collections.Generic.List`1[T]
System.Collections.Generic.Dictionary`2[TKey,TValue]
System.Collections.Generic.List`1[System.Int32]
+True
+False
Bug676.C
END-OUTPUT
*/
Modified: nemerle/trunk/ncc/typing/MType.n
==============================================================================
--- nemerle/trunk/ncc/typing/MType.n (original)
+++ nemerle/trunk/ncc/typing/MType.n Wed Feb 14 21:13:36 2007
@@ -960,16 +960,17 @@
List.FoldLeft (lst, Set (), fun (e, s : Set [TypeInfo]) {
match (e) {
| Class (tc, _) =>
- def lst = List.Map (tc.GetSuperTypes (),
- fun (x) { x.tycon });
+ def lst = tc.GetSuperTypes ().Map (_.tycon);
s.ReplaceList (lst)
- | _ => assert (false)
+ | _ => s //assert (false)
}
});
- def lst = List.Map (lst, fun (_ : MType) {
- | Class (tc, _) => tc
- | _ => assert (false)
+ def lst = lst.FoldLeft ([], fun (x : MType, acc) {
+ match (x) {
+ | Class (tc, _) => tc :: acc
+ | _ => acc //assert (false)
+ }
});
assert (Set.FromList (lst).Intersect (supers).IsEmpty);
Modified: nemerle/trunk/ncc/typing/Typer.n
==============================================================================
--- nemerle/trunk/ncc/typing/Typer.n (original)
+++ nemerle/trunk/ncc/typing/Typer.n Wed Feb 14 21:13:36 2007
@@ -1387,6 +1387,7 @@
_ = Expect (expected, InternalType.Type, "typeof result");
def ty = BindType (t);
match (ty) {
+ | MType.Tuple (args) with tc = InternalType.GetTupleType (args.Length).TyCon
| MType.Class (tc, args) =>
def is_free (a) { !(a is MType) }
if (args.Exists (is_free)) {
More information about the svn
mailing list