This commit is contained in:
Tristan B. Velloza Kildaire 2021-04-01 14:38:20 +02:00
parent 8a32272660
commit ab36f9200d
1 changed files with 5 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import std.stdio;
import gogga;
import compiler.parsing.core;
import compiler.typecheck.resolution;
import compiler.typecheck.exceptions;
/**
* The Parser only makes sure syntax
@ -201,7 +202,8 @@ public final class TypeChecker
{
string containerPath = resolver.generateName(modulle, c);
string entityPath = resolver.generateName(modulle, entity);
Parser.expect("Cannot have entity \""~entityPath~"\" with same name as container \""~containerPath~"\"");
throw new CollidingNameException(this, c, entity);
//Parser.expect("Cannot have entity \""~entityPath~"\" with same name as container \""~containerPath~"\"");
}
/**
* If there are conflicting names within the current container
@ -212,7 +214,8 @@ public final class TypeChecker
{
string preExistingEntity = resolver.generateName(modulle, findPrecedence(c, entity.getName()));
string entityPath = resolver.generateName(modulle, entity);
Parser.expect("Cannot have entity \""~entityPath~"\" with same name as entity \""~preExistingEntity~"\" within same container");
throw new CollidingNameException(this, findPrecedence(c, entity.getName()), entity);
//Parser.expect("Cannot have entity \""~entityPath~"\" with same name as entity \""~preExistingEntity~"\" within same container");
}
/**
* Otherwise this Entity is fine