Skip to content

Commit ccafcef

Browse files
committed
Made check on duplicate constructors more strict
1 parent b7d2707 commit ccafcef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/org/rascalmpl/compiler/lang/rascalcore/check/RascalConfig.rsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ void checkOverloading(map[str,Tree] namedTrees, Solver s){
479479
comparableList(t1.fields, t2.fields),
480480
! (isSyntaxType(t1) && isSyntaxType(t2))){
481481

482-
if(t1.adt == t2.adt/*&& d1.scope == d2.scope*/){
482+
if(t1.adt == t2.adt && d1.scope.path == d2.scope.path){
483483
s.addMessages([error("Constructor `<id>` overlaps with other declaration for type `<prettyAType(t1.adt)>`, see <allDefs - d.defined>", d.defined) | d <- defs ]);
484484
}
485485
}

0 commit comments

Comments
 (0)