diff --git a/source/tlang/compiler/typecheck/resolution.d b/source/tlang/compiler/typecheck/resolution.d index 1abf309..25ba733 100644 --- a/source/tlang/compiler/typecheck/resolution.d +++ b/source/tlang/compiler/typecheck/resolution.d @@ -98,24 +98,15 @@ public final class Resolver { Entity entityWithin = resolveUp(c, name); - /* If `name` was in container `c` */ + /* If `name` was in container `c` or above it */ if(entityWithin) { return entityWithin; } - /* If `name` was NOT within container `c` */ + /* If `name` was NOT found within container `c` or above it */ else { - /* If the `name` the name of the container, then return it */ - if(cmp(c.getName(), name) == 0) - { - return c; - } - /* Not found */ - else - { - return null; - } + return null; } } else @@ -143,6 +134,9 @@ public final class Resolver if(entityNext) { + /* TODO: Technically I could strip new root as we have the container */ + /* TODO: The only reason I don't want to do that is the condition */ + //newPath = newPath[indexOf(newPath, '.')+1..newPath.length]; return resolveBest(containerWithin, newPath); } else diff --git a/source/tlang/testing/basic1.t b/source/tlang/testing/basic1.t index 149b69d..6f88c02 100644 --- a/source/tlang/testing/basic1.t +++ b/source/tlang/testing/basic1.t @@ -50,7 +50,7 @@ class O : ooga { class I { - class L : myModule.ooga + class L { } @@ -61,6 +61,71 @@ class O : ooga } +class Me +{ + class You + { + class Me + { + + } + + class InnerMe : Me + { + + } + + class OuterMe + { + + } + } +} + +class Us +{ + class Container : Us + { + + } + + class Tom + { + + } + + class Poes + { + class Kak + { + + } + } +} + +class Them +{ + class Container + { + class TestInner : Container + { + + } + + class TestOuter : Us.Container + { + + } + + class Naai : Us.Poes.Kak + { + + } + + + } +} + class testClass { class test2 : testClass @@ -124,6 +189,30 @@ class testClass class L {} + class tieg : troy + { + class troy + { + + } + } + + class troy + { + + } + + + + + class gabby + { + class troy + { + + } + } + class testtest8 : testtest7, clazz1.nofuck {