-
-
Notifications
You must be signed in to change notification settings - Fork 75
Fix: Optional methods are not marked as optional (fixes #206) #207
Conversation
LGTM |
I don't think you can have optional parameters defined in a class. This would only be valid when the class is declared declare class A {
optional?();
required();
} or maybe even an abstract class abstract class A {
public abstract optional?();
public abstract required();
} The typescript parser should throw an error not sure why its not. |
I could be wrong thou it seems to work on typescript playground just seems odd to me. class A {
public optional?();
} |
If I understand the tests correctly optional properties are not allowed but optional methods are However, non of the show errors in my editor so it seems I have stumbled upon a strange corner case 😛 |
I never knew of that typescript feature. I think we may want to add tests for the other two cases, declare and abstract, and maybe not have a class with a required function without a body since that should be an error in typescript. |
I see the test case does not have a required function without a body. Never mind this should be good. |
ah, sorry for that. I focused on the optional part and didn't realize the example in the issue was invalid. But as you noticed, that isn't the same as the test :) I will add one ambient/declare and one abstract class as test cases as well. |
LGTM |
No description provided.