mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
21 lines
723 B
Plaintext
21 lines
723 B
Plaintext
user.ts(3,5): error TS2322: Type '() => void' is not assignable to type 'string'.
|
|
user.ts(4,5): error TS2322: Type '() => void' is not assignable to type 'string'.
|
|
|
|
|
|
==== demo.d.ts (0 errors) ====
|
|
declare namespace demoNS {
|
|
function f(): void;
|
|
}
|
|
declare module 'demoModule' {
|
|
import alias = demoNS;
|
|
export = alias;
|
|
}
|
|
==== user.ts (2 errors) ====
|
|
import { f } from 'demoModule';
|
|
// Assign an incorrect type here to see the type of 'f'.
|
|
let x1: string = demoNS.f;
|
|
~~
|
|
!!! error TS2322: Type '() => void' is not assignable to type 'string'.
|
|
let x2: string = f;
|
|
~~
|
|
!!! error TS2322: Type '() => void' is not assignable to type 'string'. |