Closed doopuser closed 8 years ago
Thanks! What do you do to get the error? I just tried a simple npm install doop
and made a test.ts
with the readme example pasted into it, and then tried exporting Animal
and using it from another module - all seems fine...
TypeScript spits out a compile-time error:
Return type of public property getter from exported class has or is using name 'Doop' from external module "<path>" but cannot be named.
I have something like:
import {doop} from "doop";
@doop
export default class Animal{
@doop
get color() { return doop<string, this>();}
}
It seems I need to add Doop to the imports as well.
I tried that exact code with the current version of TS (1.8.10) and the previous mainstream (1.7.5) and it's fine.
Another issue reported on doop
was due to a WebStorm bug - which IDE are you using? Do you get the issue with the command line compiler?
I'm using Visual Studio Enterprise 2015 - Update 1. I get the same error from the IDE as I do from the command line. If it doesn't repro for you, perhaps my environment has a quirk in it's configuration. Feel free to close the issue, I can keep using {doop, Doop} without much hassle. Thanks for following up!
Strange! Would be good to know what's happening, just for my understanding. Doop
(uppercase) is just an interface - if you don't refer to Doop
in your source then you should be able to forget it exists.
Love the project - the only sensible typed-immutability I've seen. I just wanted to share that the readme example throws an error if you export the class because of doop vs Doop.
import {doop, Doop} from "../doop" solves the issue.