From afbb2f144cc29148333e1662724b07fe3f188196 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 19 Dec 2020 21:54:31 -0500 Subject: [PATCH] test fail omg --- script.d | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/script.d b/script.d index 94fab7a..467f872 100644 --- a/script.d +++ b/script.d @@ -1,6 +1,9 @@ // dmd -g -ofscripttest -unittest -main script.d jsvar.d && ./scripttest /* +FIXME: fix `(new A()).b` + + FIXME: i kinda do want a catch type filter e.g. catch(Exception f) and perhaps overloads @@ -2035,6 +2038,17 @@ unittest { }); } +unittest { + // new nested class + interpret(q{ + class A {} + A.b = class B { var c; this(a) { this.c = a; } } + var c = new A.b(5); + assert(A.b.c == null); + assert(c.c == 5); + }); +} + class ForeachExpression : Expression { VariableDeclaration decl; Expression subject; @@ -2566,7 +2580,7 @@ Expression parseDottedVariableName(MyTokenStreamHere)(ref MyTokenStreamHere toke tokens.popFront(); return new DotVarExpression(ve, parseVariableName(tokens)); } - throw new ScriptCompileException("Found "~token.str~" when expecting identifier", token.scriptFilename, token.lineNumber); + return ve; }