-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Milestone
Description
Consider the overloading of int
as constructor in Type
and constructor in the syntax rule below. The type checker forbids this, the evaluator allows it. Who is right? @jurgenvinju @tvdstorm @mahills @Anastassija opinions?
[Note there are quite some syntax definitions that depend on this kind of overloading so it would be nice if we can allow it]:
module experiments::Compiler::Examples::Tst
import Type;
lexical Num = \int: [0-9]+;
gives [@mahills : I added a print statement and made the error message more informative]
addProduction: prod(label("int",lex("Num")),[iter(\char-class([range(48,57)]))],{})
|rascal://lang::rascal::types::CheckTypes|(44044,73,<873,58>,<873,131>): "Invalid addition: cannot add production RSimpleName(\"int\") into scope, it clashes with non-constructor variable or function names"