mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
755 B
TypeScript
33 lines
755 B
TypeScript
//// [tests/cases/compiler/constructorArgWithGenericCallSignature.ts] ////
|
|
|
|
//// [constructorArgWithGenericCallSignature.ts]
|
|
namespace Test {
|
|
export interface MyFunc {
|
|
<T>(value1: T): T;
|
|
}
|
|
export class MyClass {
|
|
constructor(func: MyFunc) { }
|
|
}
|
|
|
|
export function F(func: MyFunc) { }
|
|
}
|
|
var func: Test.MyFunc;
|
|
Test.F(func); // OK
|
|
var test = new Test.MyClass(func); // Should be OK
|
|
|
|
|
|
//// [constructorArgWithGenericCallSignature.js]
|
|
"use strict";
|
|
var Test;
|
|
(function (Test) {
|
|
class MyClass {
|
|
constructor(func) { }
|
|
}
|
|
Test.MyClass = MyClass;
|
|
function F(func) { }
|
|
Test.F = F;
|
|
})(Test || (Test = {}));
|
|
var func;
|
|
Test.F(func); // OK
|
|
var test = new Test.MyClass(func); // Should be OK
|