mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
616 B
TypeScript
27 lines
616 B
TypeScript
//// [tests/cases/compiler/heterogeneousArrayAndOverloads.ts] ////
|
|
|
|
//// [heterogeneousArrayAndOverloads.ts]
|
|
class arrTest {
|
|
test(arg1: number[]);
|
|
test(arg1: string[]);
|
|
test(arg1: any[]) { }
|
|
callTest() {
|
|
this.test([1, 2, 3, 5]);
|
|
this.test(["hi"]);
|
|
this.test([]);
|
|
this.test([1, 2, "hi", 5]); // Error
|
|
}
|
|
}
|
|
|
|
//// [heterogeneousArrayAndOverloads.js]
|
|
"use strict";
|
|
class arrTest {
|
|
test(arg1) { }
|
|
callTest() {
|
|
this.test([1, 2, 3, 5]);
|
|
this.test(["hi"]);
|
|
this.test([]);
|
|
this.test([1, 2, "hi", 5]); // Error
|
|
}
|
|
}
|