-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wunused: Include import selector bounds in unused checks
closes lampepfl#17314
- Loading branch information
1 parent
40502e0
commit 12cd96e
Showing
4 changed files
with
81 additions
and
12 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,14 @@ | ||
// scalac: -Wunused:all | ||
|
||
package foo: | ||
class Foo[T] | ||
given Foo[Int] = new Foo[Int] | ||
|
||
|
||
package bar: | ||
import foo.{given foo.Foo[Int]} // error | ||
import foo.Foo | ||
|
||
given Foo[Int] = ??? | ||
|
||
val repro: Foo[Int] = summon[Foo[Int]] |
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,33 @@ | ||
// scalac: "-Wunused:all" | ||
|
||
import java.net.URI | ||
|
||
object circelike { | ||
import scala.compiletime.summonInline | ||
import scala.deriving.Mirror | ||
|
||
type Codec[T] | ||
type Configuration | ||
trait ConfiguredCodec[T] | ||
object ConfiguredCodec: | ||
inline final def derived[A](using conf: Configuration)(using | ||
inline mirror: Mirror.Of[A] | ||
): ConfiguredCodec[A] = | ||
new ConfiguredCodec[A]: | ||
val codec = summonInline[Codec[URI]] // simplification | ||
} | ||
|
||
object foo { | ||
import circelike.{Codec, Configuration} | ||
|
||
given Configuration = ??? | ||
given Codec[URI] = ??? | ||
} | ||
|
||
object bar { | ||
import circelike.Codec | ||
import circelike.{Configuration, ConfiguredCodec} | ||
import foo.{given Configuration, given Codec[URI]} | ||
|
||
case class Operator(url: URI) derives ConfiguredCodec | ||
} |
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,12 @@ | ||
// scalac: -Wunused:all | ||
|
||
package foo: | ||
class Foo[T] | ||
given Foo[Int] = new Foo[Int] | ||
|
||
|
||
package bar: | ||
import foo.{given foo.Foo[Int]} | ||
import foo.Foo | ||
|
||
val repro: Foo[Int] = summon[Foo[Int]] |