Allow shadowing of types

parser_exception_before
Tristan B. V. Kildaire 2021-03-30 21:36:35 +02:00
parent e7905aace2
commit 9b84fc3428
2 changed files with 19 additions and 14 deletions

View File

@ -325,17 +325,19 @@ public final class TypeChecker
} }
} }
/* Find the name starting in upper cotainer */ /* TODO: We allow shaddowing so below is disabled */
Entity clazzAbove = resolveUp(parentContainer, clazz.getName()); /* TODO: We should however use the below for dot-less resolution */
// /* Find the name starting in upper cotainer */
// Entity clazzAbove = resolveUp(parentContainer, clazz.getName());
if(!clazzAbove) // if(!clazzAbove)
{ // {
} // }
else // else
{ // {
Parser.expect("Name in use abpve us, bad"~to!(string)(clazz)); // Parser.expect("Name in use abpve us, bad"~to!(string)(clazz));
} // }
/* If the Container's parent container is Module then we can have /* If the Container's parent container is Module then we can have
/* TODO: Check that it doesn;t equal any class up the chain */ /* TODO: Check that it doesn;t equal any class up the chain */

View File

@ -50,14 +50,17 @@ public class clazz1
class bruh2 class bruh2
{ {
} }
} }
class bruh
{
}
} }
class myModule
{
}
class bruh class bruh
{ {