Cleaned up CollidingNameException

This commit is contained in:
Tristan B. Velloza Kildaire 2021-04-02 10:42:07 +02:00
parent 0e79bc77ed
commit ca7fa39f34
1 changed files with 2 additions and 2 deletions

View File

@ -42,8 +42,7 @@ public final class CollidingNameException : TypeCheckerException
this.attempted = attempted;
this.c = c;
/* TODO: Set `msg` */
/* TODO: (Gogga it) Generate the error message */
/* If colliding with the container */
if(isCollidingWithContainer())
{
string containerPath = typeChecker.getResolver().generateName(typeChecker.getModule(), defined);
@ -56,6 +55,7 @@ public final class CollidingNameException : TypeCheckerException
string entityPath = typeChecker.getResolver().generateName(typeChecker.getModule(), attempted);
msg = "Cannot have entity \""~entityPath~"\" with same name as module \""~typeChecker.getModule().getName()~"\"";
}
/* If colliding with a member within the container */
else
{
string preExistingEntity = typeChecker.getResolver().generateName(typeChecker.getModule(), typeChecker.findPrecedence(c, attempted.getName()));