-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Question marks (JSDoc types) allowable in instantiation expression type arguments #51802
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Note that without the question marks my code does not compile. |
Nor should it. You can change |
|
If your codebase forbids use of |
@mike-lischke That's not really relevant to this issue, unfortunately. By using |
You control the linter. Don't let the linter control you. |
I just detected the possibility of using question marks and asked about it on SO, which in turn let to this issue here. Additionally, it solved my problem at hand and it's not yet clear if it is a bug ¯\(ツ)/¯ |
That's fair, though it definitely feels like a bug since We'll see what the maintainers say. |
This is definitely a bug. We're forgetting to visit child nodes in |
Bug Report
🔎 Search Terms
instantiation expressions, question mark, jsdoc nullable, any, Java wildcard
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
No compiler errors. The question marks seem to be treated like JSDoc nullable types and a question mark by itself seems to be interpreted as
any
(not sure if that's true for JSDoc either).🙂 Expected behavior
Compiler errors on every question mark, saying that it's not valid, perhaps with a "JSDoc types are not allowed here" message.
This Stack Overflow question is asking about how to use the Java wildcard syntax in TypeScript, and I'm like 🤯. Apparently this was suggested by VSCode type hints. I don't know much about JSDoc but I assume some support for it has accidentally leaked into instantiation expression checking.
The text was updated successfully, but these errors were encountered: