Open
Description
void main<T>() {
print(T);
print('hi');
}
According to the spec section 19.6, for main
to be called executed it needs to have zero, one, or two arguments.
If a library exports main
but it's not a script then it's a compile time error.
However the program above is accepted by the front end.
How it works today is VM runs it by doing a dynamic invocation:
Which passes dynamic
for the missing type arguments.
Instead this program should be rejected by the front end, per spec.