Skip to content

Commit b0c1aa4

Browse files
committed
Typecheck varparam IVariable to CArray
Typecheck varparam IVariable to CArray instead of their `int...` varparam type that is not supported as a useable array type.
1 parent 2677c9c commit b0c1aa4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/main/java/com/laytonsmith/core/compiler/analysis/StaticAnalysis.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.laytonsmith.core.compiler.signature.FunctionSignatures;
1818
import com.laytonsmith.core.compiler.signature.SignatureBuilder;
1919
import com.laytonsmith.core.constructs.Auto;
20+
import com.laytonsmith.core.constructs.CArray;
2021
import com.laytonsmith.core.constructs.CClassType;
2122
import com.laytonsmith.core.constructs.CFunction;
2223
import com.laytonsmith.core.constructs.CKeyword;
@@ -467,7 +468,8 @@ public CClassType typecheck(ParseTree ast, Environment env, Set<ConfigCompileExc
467468
return CClassType.AUTO;
468469
} else {
469470
// TODO - Get the most specific type when multiple declarations exist.
470-
return decls.iterator().next().getType();
471+
CClassType varType = decls.iterator().next().getType();
472+
return (varType.isVariadicType() ? CArray.TYPE : varType);
471473
}
472474
} else {
473475
// If this runs, then an IVariable reference was created without setting its Scope using setTermScope().

0 commit comments

Comments
 (0)