diff --git a/source/tlang/compiler/typecheck/expression.d b/source/tlang/compiler/typecheck/expression.d index 0b11e1c0..6352e05b 100644 --- a/source/tlang/compiler/typecheck/expression.d +++ b/source/tlang/compiler/typecheck/expression.d @@ -14,7 +14,7 @@ import compiler.symbols.typing.core; import compiler.symbols.typing.builtins; import compiler.typecheck.dependency; -public final class ExpressionDNode : DNode +public class ExpressionDNode : DNode { private Expression expression; @@ -30,4 +30,33 @@ public final class ExpressionDNode : DNode { name = "[expression]"; } +} + +/** +* AccessNode +* +* An AccessNode represents a accessor call +* This can be as simple as `a` or `a.a` +*/ +public class AccessDNode : DNode +{ + /** + * Construct a new AccessNode given the `entity` + * being accessed + */ + this(DNodeGenerator dnodegen, Entity entity) + { + super(dnodegen, entity); + // this.entity = entity; + + + initName(); + } + + private void initName() + { + name = resolver.generateName(cast(Container)dnodegen.root.getEntity(), cast(Entity)entity); + name = "[AccessNode] (Name: "~name~")"; + + } } \ No newline at end of file diff --git a/source/tlang/misc/exceptions.d b/source/tlang/misc/exceptions.d index d2b04d65..36118418 100644 --- a/source/tlang/misc/exceptions.d +++ b/source/tlang/misc/exceptions.d @@ -12,6 +12,6 @@ public class TError : Exception //super(messageBytes); - super(""); + super(message); } } \ No newline at end of file diff --git a/source/tlang/testing/typecheck/basic_dependence_correct3.t b/source/tlang/testing/typecheck/basic_dependence_correct3.t new file mode 100644 index 00000000..973e0924 --- /dev/null +++ b/source/tlang/testing/typecheck/basic_dependence_correct3.t @@ -0,0 +1,30 @@ +module typeChecking2; + +A aInstance; +B bInstance; + +int j = k; +int k = j; + + +class A +{ + static int pStatic; + static B bInstanceStatic; + static A aInstanceStaticMoi; + + int poes; +} + +class B +{ + static int jStatic; + static A aInstanceStatic; +} + +class C +{ + static int j=k; + static int k; + int p; +}