Made class name constraints good. You can have your duplicate names nested but not at same level
parent
16435c204e
commit
e7905aace2
|
@ -313,6 +313,36 @@ public final class TypeChecker
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Get the current container's parent container */
|
||||
Container parentContainer = c.parentOf();
|
||||
|
||||
/* If c (container is Module) then it has no Parent */
|
||||
if(!parentContainer)
|
||||
{
|
||||
if(cmp(c.getName(), clazz.getName()) == 0)
|
||||
{
|
||||
Parser.expect("Cannot use name of module, in use");
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the name starting in upper cotainer */
|
||||
Entity clazzAbove = resolveUp(parentContainer, clazz.getName());
|
||||
|
||||
if(!clazzAbove)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Parser.expect("Name in use abpve us, bad"~to!(string)(clazz));
|
||||
}
|
||||
|
||||
/* 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: Exclude Module from this */
|
||||
|
||||
|
||||
|
||||
// /* Still check if there is something with our name above us */
|
||||
// Container parentContainer = c.parentOf();
|
||||
|
||||
|
|
|
@ -21,16 +21,16 @@ public ubyte k = 1;
|
|||
private ubyte k2 = 1;
|
||||
protected ubyte k3 = -1;
|
||||
|
||||
class ooga : P
|
||||
class ooga : O
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class P : ooga
|
||||
class O : ooga
|
||||
{
|
||||
class P
|
||||
class I
|
||||
{
|
||||
class P : ooga
|
||||
class L : ooga
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -45,20 +45,25 @@ public class clazz1
|
|||
int k;
|
||||
print("Hello world");
|
||||
|
||||
public class clazz1
|
||||
public class clazz3
|
||||
{
|
||||
class clazz1
|
||||
class bruh2
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class myModule
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class bruh
|
||||
{
|
||||
class L
|
||||
class bruh1
|
||||
{
|
||||
class bruh
|
||||
class bruh2
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -67,15 +72,15 @@ class bruh
|
|||
|
||||
class clazz2 : bruh
|
||||
{
|
||||
class clazz2
|
||||
class clazzU
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class clazz1
|
||||
class clazz12
|
||||
{
|
||||
int j;
|
||||
private class clazz_2_2_1 : bruh, bruh2
|
||||
private class clazz_2_2_1 : bruh, clazzU
|
||||
{
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue