Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
558 stars 42 forks source link

Invalid typealiases generated for @actions/tool-cache #399

Open Vampire opened 4 years ago

Vampire commented 4 years ago

If you generate for @actions/tool-cache, the tool-cache.module_@actions_tool-cache.kt file contains these three:

typealias HTTPError = Error
typealias IToolRelease = IToolRelease
typealias IToolReleaseFile = IToolReleaseFile

For the first, #398 applies. But for the other two it seems little helpful to re-alias them. The according TS declarations are

import * as mm from './manifest';
export declare class HTTPError extends Error {
    readonly httpStatusCode: number | undefined;
    constructor(httpStatusCode: number | undefined);
}
export declare type IToolRelease = mm.IToolRelease;
export declare type IToolReleaseFile = mm.IToolReleaseFile;

And here the compilation errors:

e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\manifest.module_@actions_tool-cache.kt: (18, 20): Redeclaration: IToolReleaseFile
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\manifest.module_@actions_tool-cache.kt: (28, 20): Redeclaration: IToolRelease
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\tool-cache.module_@actions_tool-cache.kt: (19, 1): Can't put non-external declarations in file marked with JsModule annotation
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\tool-cache.module_@actions_tool-cache.kt: (43, 1): Can't put non-external declarations in file marked with JsModule annotation
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\tool-cache.module_@actions_tool-cache.kt: (43, 11): Redeclaration: IToolRelease
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\tool-cache.module_@actions_tool-cache.kt: (45, 1): Can't put non-external declarations in file marked with JsModule annotation
e: D:\Sourcecode\other\setup-wsl\build\externals\setup-wsl\src\tool-cache.module_@actions_tool-cache.kt: (45, 11): Redeclaration: IToolReleaseFile