New type system.

This commit is contained in:
David Anderson
2014-06-24 23:37:14 -07:00
parent 2ae04ee1df
commit 99f4cdb3e4
25 changed files with 656 additions and 479 deletions
@@ -0,0 +1,11 @@
methodmap Y
{
};
class X < Y
{
};
public main()
{
}
@@ -0,0 +1 @@
cannot mix methodmaps and classes with inheritance
@@ -0,0 +1,11 @@
class Y
{
};
methodmap X < Y
{
};
public main()
{
}
@@ -0,0 +1 @@
cannot mix methodmaps and classes with inheritance
@@ -0,0 +1,13 @@
class X
{
};
f(X:x)
{
return 3
}
public main()
{
return f(2);
}
@@ -0,0 +1 @@
cannot coerce non-object type int to object type X
@@ -0,0 +1,14 @@
class X
{
};
f(any:x)
{
return 3
}
public main()
{
new X:x;
return f(x);
}
@@ -0,0 +1 @@
cannot coerce object type X to non-object type any
@@ -0,0 +1,14 @@
class X
{
};
f({X,Float}:x)
{
return 3
}
public main()
{
new X:x;
return f(x);
}
@@ -0,0 +1 @@
cannot use an object in a multi-tag selector
@@ -0,0 +1,14 @@
class X
{
};
f(x)
{
return 3
}
public main()
{
new X:x;
return f(x);
}
@@ -0,0 +1 @@
cannot coerce object type X to non-object type int
@@ -0,0 +1,14 @@
class X
{
};
f(...)
{
return 3
}
public main()
{
new X:x;
return f(x);
}
@@ -0,0 +1 @@
cannot coerce object type X to non-object type int
@@ -0,0 +1,14 @@
class X
{
};
f(X:x)
{
return 3
}
public main()
{
new x;
return f(X:x);
}
@@ -0,0 +1 @@
cannot coerce non-object type int to object type X
@@ -0,0 +1,14 @@
class X
{
};
f(x)
{
return 3
}
public main()
{
new X:x;
return f(_:x);
}
@@ -0,0 +1 @@
cannot coerce object type X to non-object type int