make variable arity parameters an array type

This commit is contained in:
Dave Holoway
2020-06-10 14:50:40 +01:00
parent 6dffe61d62
commit b175b52065

View File

@@ -251,6 +251,10 @@ class SourceParameter extends Parameter {
} }
get type() { get type() {
if (this.varargs) {
// variable arity parameters are automatically an array type
return new ArrayType(this._paramType.resolved, 1);
}
return this._paramType.resolved; return this._paramType.resolved;
} }
} }