-
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
Strange warning with -Ysafe-init #14275
Comments
I can try to fix this |
Xavientois
added a commit
to Xavientois/dotty
that referenced
this issue
Jan 25, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Review by @liufengyun
Xavientois
added a commit
to Xavientois/dotty
that referenced
this issue
Feb 2, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Review by @liufengyun
Xavientois
added a commit
to Xavientois/dotty
that referenced
this issue
Feb 2, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Review by @liufengyun
Xavientois
added a commit
to Xavientois/dotty
that referenced
this issue
Feb 2, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Signed the CLA - @Xavientois Review by @liufengyun
Xavientois
added a commit
to Xavientois/dotty
that referenced
this issue
Feb 2, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Signed the CLA - @Xavientois Review by @liufengyun
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 2022
Closes scala#14275 - Treats mehtods `ne`, `eq`, `isInstanceOf`, and `asInstanceOf` as safe to call, regardless of initialization Signed the CLA - @Xavientois Review by @liufengyun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.1.0 (using
-Ysafe-init
)Minimized code
Output
Using
eq
instead ofne
results in a similar warning.Expectation
Unless I'm missing something, calling
ne
oreq
is safe on any value (in fact, they can even be called onnull
). So I would expect no warning in these cases.The text was updated successfully, but these errors were encountered: