-
Notifications
You must be signed in to change notification settings - Fork 261
Double definitions not recognized #380
Comments
It's fixed in latest release |
@unional I think it's a separate issue, I've updated to that update before I issued this. |
Yup. Just realized that. |
@unional Any idea what the problem might is? |
Need the master to handle this. As said in the error, the protected field is what caused the incompatibility. (private fields too). If I remove Private properties shouldn't be included in declaration, for sure. I'm not sure about protected properties. Likely this involves TypeScript team. @blakeembrey thoughts? |
I'll look through existing TypeScript issues to understand the reasoning here from TypeScript's team, but it's pretty simple to verify in a standalone test: export class Test {
private method () {}
}
export class Test2 {
private method () {}
}
export function compare (t: Test) {}
compare(new Test2())
|
Seems like microsoft/TypeScript#6496 and microsoft/TypeScript#6365 are relevant here. I can't tell the real reasoning right now why |
@blakeembrey Thanks clearing that up. What would you recommend for now so that the Item satisfies the Model? I've made the property protected which causes the same error. The only route is to make it public i guess? |
From the spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3112-type-and-member-identity. You can create an interface inline that describes what the value should conform to instead of using the class type. E.g. |
I'm going to open an issue to see if I can understand more, at the very least it'll be closed as a duplicate but it'll alert them that it's maybe an issue. |
Ah, I see you already created microsoft/TypeScript#7743 too. I guess we'll see what gets said anyway. |
@blakeembrey Yes, we'll see. |
Ok, looks like making an abstract interface may be the best way for now until Typings/TypeScript can handle de-duping better. |
Closing as answered for now. |
I see some unexpected behaviour having several definitions that appear in multiple packages that have the same dependencies. I reach out because I'm not sure if it's me misusing it or typings needing improvement.
To test this:
clone https://github.com/redound/exp-typings.git cd exp-typings typings install tsc
Then you get the above error indicating that EventEmitter and EventEmitter are incompatible. (It's the same EventEmitter).
The text was updated successfully, but these errors were encountered: