mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
22 lines
358 B
TypeScript
22 lines
358 B
TypeScript
//// [tests/cases/compiler/assignToFn.ts] ////
|
|
|
|
//// [assignToFn.ts]
|
|
namespace M {
|
|
interface I {
|
|
f(n:number):boolean;
|
|
}
|
|
|
|
var x:I={ f:function(n) { return true; } };
|
|
|
|
x.f="hello";
|
|
}
|
|
|
|
|
|
//// [assignToFn.js]
|
|
"use strict";
|
|
var M;
|
|
(function (M) {
|
|
var x = { f: function (n) { return true; } };
|
|
x.f = "hello";
|
|
})(M || (M = {}));
|