Open
Description
Link to minimal reproduction
Steps to reproduce
It is self-contained in the provided the SFC Playground reproduction
What is expected?
It is expected that
const test: ITest = reactive<ITest>(testObj);
works properly in regard to type matching.
What is actually happening?
I get an error from the TypeScript language server in VSC.
TypeScript types matching with reactive
are not handling properly classes. It reduces them to empty objects {}
System Info
System:
OS: macOS 11.4
CPU: (8) x64 Apple M1
Memory: 21.72 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 8.1.0 - /usr/local/bin/npm
Browsers:
Chrome: 101.0.4951.64
Chrome Canary: 104.0.5061.0
Edge: 96.0.1054.62
Firefox: 99.0
Safari: 14.1.1
npmPackages:
vue: ^3.2.33 => 3.2.33
Any additional comments?
If this is a technical limitation and we have to do some workarounds it should be mentioned in reactive doc but there is no mention.
I can imagine we should use interfaces instead of classes but again, it would be a serious drawback for various use-cases.