typescript-plus icon indicating copy to clipboard operation
typescript-plus copied to clipboard

期望大佬升级typescript

Open septbr opened this issue 5 years ago • 7 comments
trafficstars

class X {
    public go(data: { arg1: number }) { }
}
class Y {
    public x?: { call: () => void } = { call: () => console.log('x?.call();') }
    public go(data: { arg1: number, arg2?: string }) { }
}
let x = new X(), y = new Y();

// error TS2349: Cannot invoke an expression whose type lacks a call signature.
// Type '((data: { arg1: number; }) => void) | ((data: { arg1: number; arg2?: string; }) => void)' has no compatible call signatures.
let go: typeof x.go | typeof y.go = x.go;
go({ arg1: 0 });

// error: Optional Chaining in typescript 3.7.x
y?.x.call();

septbr avatar Jan 15 '20 14:01 septbr

@septrd https://github.com/eos3tion/TypeScript-plus/tree/v3.7.2plus

eos3tion avatar Jan 17 '20 05:01 eos3tion

谢谢

------------------ 原始邮件 ------------------ 发件人: "程方"<[email protected]>; 发送时间: 2020年1月17日(星期五) 中午1:42 收件人: "domchen/typescript-plus"<[email protected]>; 抄送: "iCunda"<[email protected]>; "Mention"<[email protected]>; 主题: Re: [domchen/typescript-plus] 期望大佬升级typescript (#20)

@septrd https://github.com/eos3tion/TypeScript-plus/tree/v3.7.2plus

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

septbr avatar Jan 17 '20 07:01 septbr

@septrd https://github.com/eos3tion/TypeScript-plus/tree/v3.7.2plus 貌似你删除了不少函数,例如reorderSourceFiles,不能直接替换掉白鹭的呢。。。。

sylarlin avatar Apr 09 '21 04:04 sylarlin

@septrd https://github.com/eos3tion/TypeScript-plus/tree/v3.7.2plus 貌似你删除了不少函数,例如reorderSourceFiles,不能直接替换掉白鹭的呢。。。。

你有找到可替换的吗

robinch-top avatar Jul 08 '21 07:07 robinch-top

@sylarlin @robinch-top 可以直接替换白鹭啊,我再白鹭发了另外一个合并请求 https://github.com/egret-labs/egret-core/pull/302 我自己的白鹭项目用的很正常

eos3tion avatar Jul 09 '21 01:07 eos3tion

@sylarlin @robinch-top 可以直接替换白鹭啊,我再白鹭发了另外一个合并请求 egret-labs/egret-core#302 我自己的白鹭项目用的很正常

是直接替换Egret\engine\5.2.33\tools\lib\typescript-plus\lib吗 我在使用5.2.33版本 使用https://github.com/eos3tion/TypeScript-plus/tree/v3.7.2plus 中lib替换了plus中lib 并不能正常编译通过 报错:TypeError: ts.reorderSourceFiles is not a function

robinch-top avatar Jul 09 '21 03:07 robinch-top

我改了一个ts5.0.4版本的typescript-plus,https://github.com/1045290202/typescript-plus,有需要可以试试

1045290202 avatar Aug 29 '23 07:08 1045290202