Replace symbol proxies with type symbols.

Proxies were rather hacky and complicated, and only existed as a
workaround for oddities with constructors. This patch replaces them with
actual type symbols, a very tiny step to semantically getting rid of tags.

This greatly simplifies how we implement constructors, and paves the way
for using methodmap symbols in field expressions.

Since non-value symbols are new to spcomp1, we place a rather
pigeonholed check into primary() to make sure non-value symbols don't
escape into expressions.
This commit is contained in:
David Anderson
2014-12-12 10:10:43 -08:00
parent 46d620cb6a
commit afeae84340
9 changed files with 148 additions and 111 deletions
@@ -1,3 +1,3 @@
(1) : error 001: expected token: "-identifier-", but found ")"
(5) : error 140: new-style array types cannot specify dimension sizes as part of their type
(9) : error 001: expected token: "-identifier-", but found ":"
(9) : warning 238: 'int:' is an illegal cast; use view_as<int>(expression)
@@ -0,0 +1,17 @@
native printnum(x);
enum X {
};
methodmap X {
public X(int y) {
printnum(y);
return view_as<X>(0);
}
};
public main()
{
X x = X(5);
return X;
}
@@ -0,0 +1 @@
(16) : error 174: symbol 'X' is a type and cannot be used as a value