You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
➜ snips scala compile --server=false-S2.13.15-Xsource:3-cross -Wunused packaging.scala
/home/amarki/snips/packaging.scala:6:error: not found: typeCoverridedeftoString=newC().toString +" for Test"
^
/home/amarki/snips/packaging.scala:4:warning: Unusedimportimportq.*
^
1 warning
1 error
Compilation failed
➜ snips scala compile --server=false-Wunused:all packaging.scala
-- [E006] NotFoundError:/home/amarki/snips/packaging.scala:6:34-----------------------------------------------------6|overridedeftoString=newC().toString +" for Test"| ^
|Notfound: typeC|| longer explanation available when compiling with`-explain`1 error found
Compilation failed
Expectation
I refactored a test package from package p to
package test.p
import p.*
(in order to test public API) and was pleased that I didn't have to write import _root_.p.*.
As expected, with nested packages, the import sees the nested p.q. However, I also expected some indication that my import is spurious.
I know that importing is generous, so that if an import and definition resolve to the same symbol, it won't annoy me with cautionary messages. But I'd like a way to ask for warnings.
Scala 2 knows that the import is unused, but Scala 3 is willing to take it as used.
The text was updated successfully, but these errors were encountered:
Compiler version
3.5.1
Minimized code
Output
Expectation
I refactored a test package from
package p
to(in order to test public API) and was pleased that I didn't have to write
import _root_.p.*
.As expected, with nested packages, the import sees the nested
p.q
. However, I also expected some indication that my import is spurious.I know that importing is generous, so that if an import and definition resolve to the same symbol, it won't annoy me with cautionary messages. But I'd like a way to ask for warnings.
Scala 2 knows that the import is unused, but Scala 3 is willing to take it as used.
The text was updated successfully, but these errors were encountered: