-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix #16173: SJS: Fix the detection of inferred types of = js.native
.
#16184
Conversation
I'm not convinced this is the right fix, the code mentioned in the issue is if (tree.tpt.span.isSynthetic)
report.error(i"The type of ${tree.name} must be explicitly specified because it is JS native.", tree) If you want to check if the type was inferred, you should be able to do |
a293cf6
to
488aa27
Compare
= js.native
.
That is indeed a better fix, thanks. I've updated the PR. That said, is it still not wrong that literal type trees get a synthetic span? 🤔 |
I guess you could do |
@@ -981,7 +981,7 @@ class PrepJSInterop extends MacroTransform with IdentityDenotTransformer { thisP | |||
|
|||
// Check that the resul type was explicitly specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drive-by typo suggestion:
// Check that the resul type was explicitly specified | |
// Check that the result type was explicitly specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
…tive`. Use `tpt.isInstanceOf[InferredTypeTree]` instead of relying on the span being synthetic.
488aa27
to
63f96f0
Compare
No description provided.