Skip to content

Commit e889605

Browse files
committed
Fix compile error on post-assign non-cast parenthesis
Fixes compile error in the following example code: ``` @A = (1 + 2) msg(123) ```
1 parent 253b5ea commit e889605

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/laytonsmith/core/functions/Compiler.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ public static ParseTree rewrite(List<ParseTree> list, boolean returnSConcat,
222222
|| (list.get(index).getData() instanceof CFunction cf
223223
&& cf.hasFunction() && cf.getFunction() != null
224224
&& cf.getFunction().getName().equals(Compiler.p.NAME)
225-
&& list.get(index).numberOfChildren() == 1))) {
225+
&& list.get(index).numberOfChildren() == 1
226+
&& (list.get(index).getChildAt(0).getData() instanceof CClassType
227+
|| __type_ref__.createFromBareStringOrConcats(
228+
list.get(index).getChildAt(0)) != null)))) {
226229
valChildren.add(list.get(index));
227230
list.remove(index);
228231
}

0 commit comments

Comments
 (0)