-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
No warnings when getter/setter is missing from interface type. #33116
Comments
I don't believe this is duplicate. I don't want additional new features. Just want a warning that it's incomplete. If the interface is saying the property is read-write, but the implementation only knows how to read and not write then expect to see an error/warning to say it's incomplete. |
The machinery that would be required to produce that error is #21759. |
Ok then. The title is very misleading for that then. That a warning for read-only (thing that already exists) would require write-only functionality to be added? |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
1 similar comment
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
That seems like a duplicate message, how do I mark the bot as a duplicate and close it's message for house-keeping purposes? |
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
1 similar comment
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Seriously, what the fuck is with this bot? Every 3 days, regardless if the task is open or closed, he keeps messaging.. |
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
type setter no warning, type setter, type getter, type getter setter warning
Code
Expected behavior:
variable
b
to show warning that it is an incomplete model,variable
c
to show warning it's an incomplete modelActual behavior:
no warnings, but runtime errors
Cannot set property prop of #<Object> which has only a getter
Playground Link:
https://www.typescriptlang.org/play/?target=6#code/JYOwLgpgTgZghgYwgAgILIN4Chm+VCOAEwHsQAbAT2QAcoSaAuZAIxJPMJAG4sBfLFgRkAzmGRxm6ALyYceOg2bxyIiP0HCQY1lOSzseZAHMI4xTQAUASjlGjBMAFcoIZCrW8jAgVp0I9A3lcNXN6KwA3OHInCGY2Di5bDB8sOAA6C31kMChY3hZM8Ozc-KEihhK8iG4gA
Related Issues:
Follow-up
I would not expect b to show an error that no setter is supplied if the interface was
since prop is expected to not have a setter.
And at this point
c
is completely invalid, but again, still no warnings about c object directly, but atleastCannot assign to 'prop' because it is a read-only property.
is reported fora.prop = true
ts-config
The text was updated successfully, but these errors were encountered: