Closed
Description
TypeScript Version: 3.6.2
Search Terms:
- union type
- partial
Repo
-
git clone https://github.com/Microsoft/typescript-template-language-service-decorator
-
npm install
-
Open
src/template-language-service-decorator.ts
-
On line 44, remove the any cast on the line:
for (const { name, wrapper } of this._wrappers) { (intercept[name] as any) = wrapper(languageService[name]!.bind(languageService)); }
-
Try compiling the project
Expected behavior:
This compiles with TS 3.4
Actual behavior:
Compile fails with TS 3.5+
src/template-language-service-decorator.ts:44:13 - error TS2590: Expression produces a union type that is too complex to represent.
44 intercept[name] = wrapper(languageService[name]!.bind(languageService));
~~~~~~~~~~~~~~~
The code likely needs to be rewritten here but I'm opening this issue to make sure the error is expected
Playground Link:
Related Issues: