-
Notifications
You must be signed in to change notification settings - Fork 686
Closed
Description
For some reason stable TS accepts this:
interface Foo {
foo(x: any): void;
foo: (x: any) => void;
}
With no error.
However stable TS does NOT accept this:
interface Foo {
foo: (x: any) => void;
foo(x: any): void;
}
With the error Duplicate identifier 'foo'.
twice.
Meanwhile TSGo does not accept either of these. I would not raise this as an issue if it weren't for two facts:
- I observed this actually happening with real code;
@types/chai
andvitest
declarecontainSubset(val: any, exp: any, msg?: string): void;
andcontainSubset: (val: any, exp: any, msg?: string) => void;
respectively - TSGo is aiming to be a 1:1 port so even weird behavior like this should be supported.
I would actually support revisiting these semantics such that either both are an error (like it is here) or neither are an error. I find the fact that order matters here surprising. If that is the decision I would like a clear answer so I can file an issue against packages with this issue.
Metadata
Metadata
Assignees
Labels
No labels