-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function property is mis-interpreted as method #1637
Comments
In current project I'm using TypeDoc raw data output. It looks like after the change mentioned above the React/React Native functional components props data has been stripped or moved too. If I downgrade to Environment
|
From a code generation perspective that targets compiled languages, I can see your point here... however, I'm not sure that this behavior is something that should be reverted. TypeDoc has done the same thing for property-methods for a long time, its detection for these was just improved in a way that broke your use case. class Foo {
iAmMethod = (x: string) => parseInt(x)
}
I can't seem to reproduce this, open a new issue with a reproduction to keep different problems separate please. |
Just got bitten by this issue after an upgrade. Seems wrong for my particular use case too. Now the same member will show as a method in the interface and as a property in the implementing class: interface Foo {
prop: () => void;
// "kindString": "Method"
}
class FooClass implements Foo {
prop: () => void;
// "kindString": "Property",
// "implementationOf": {
// "type": "reference",
// "name": "Foo.prop"
// }
} |
Hmm... that's actually a really good argument for not turning property-methods into methods in type space... Once TS 4.7 releases, with explicit variance annotations, it won't be necessary to declare intended methods as properties in order to get the correct variance, which should make property-methods less frequent... if the comment plugin is updated so that it can properly inherit comments from property-methods, I think I'm okay with reverting this... |
Search terms
Function property, method
Expected Behavior
This should be interpreted as a function property:
Actual Behavior
Instead, typedoc generates a method node for it:
Steps to reproduce the bug
test.ts:
tsconfig.json:
Environment
The text was updated successfully, but these errors were encountered: