forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#8459 from som-snytt/issue/11758
Check unused imports for undesirable properties
- Loading branch information
Showing
3 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
t11758.scala:3: warning: Unused import of deprecated lazy value higherKinds: higherKinds no longer needs to be imported explicitly | ||
import language.higherKinds | ||
^ | ||
t11758.scala:19: warning: Unused import from deprecated object outer: no outer | ||
import outer.other | ||
^ | ||
t11758.scala:21: warning: Unused import of deprecated object inner: no inner | ||
import outer.{inner => odder} | ||
^ | ||
t11758.scala:25: warning: Unused import of deprecated class C: no see | ||
import nest.C | ||
^ | ||
t11758.scala:23: warning: object inner in object outer is deprecated (since 2.0): no inner | ||
def f = inner | ||
^ | ||
t11758.scala:23: warning: object outer is deprecated (since 1.0): no outer | ||
def f = inner | ||
^ | ||
t11758.scala:30: warning: class C in object nest is deprecated (since 3.0): no see | ||
def g = new C | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
7 warnings | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// scalac: -Xlint:deprecation -Wunused:imports -Werror | ||
|
||
import language.higherKinds | ||
|
||
@deprecated("no outer", "1.0") | ||
object outer { | ||
@deprecated("no inner", "2.0") | ||
object inner | ||
object other | ||
} | ||
object nest { | ||
@deprecated("no see", "3.0") | ||
class C | ||
|
||
val status = true | ||
} | ||
|
||
trait T { | ||
import outer.other | ||
import outer.inner | ||
import outer.{inner => odder} | ||
|
||
def f = inner | ||
|
||
import nest.C | ||
def g = () | ||
} | ||
trait U { | ||
import nest.C | ||
def g = new C | ||
} | ||
trait OK { | ||
import nest.{C => _, _} | ||
def ok = status | ||
} |