rascal icon indicating copy to clipboard operation
rascal copied to clipboard

In overlapping names, order matters for the typechecker

Open DavyLandman opened this issue 1 year ago • 0 comments

This fails to typecheck:

import String; // contains function left

data X = nested(list[Y] ys = [Y::left()]);

data Y 
    = left()
    | right()
    ;

with error (on Y::left):

Cannot call Y::left with 0 argument(s), given definitions str(str,int) or str(str,int,str)

while this succeeds:

import String; // contains function left

data Y 
    = left()
    | right()
    ;

data X = nested(list[Y] ys = [Y::left()]);

DavyLandman avatar Aug 30 '24 14:08 DavyLandman