-
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.
- Loading branch information
Showing
4 changed files
with
68 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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
//> using options -Xfatal-warnings -Wunused:all | ||
//> using options -Werror -Wunused:all | ||
|
||
trait Builder { | ||
def foo(): Unit | ||
} | ||
|
||
def repro = | ||
def `i18366` = | ||
val builder: Builder = ??? | ||
import builder.{foo => bar} | ||
bar() | ||
bar() | ||
|
||
import java.io.DataOutputStream | ||
|
||
val buffer: DataOutputStream = ??? | ||
|
||
import buffer.{write => put} | ||
|
||
def `i17315` = | ||
put(0: Byte) |
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,28 @@ | ||
//> using options -Wunused:all | ||
|
||
class A | ||
class B | ||
|
||
def Test() = | ||
val ordA: Ordering[A] = ??? | ||
val ordB: Ordering[B] = ??? | ||
val a: A = ??? | ||
val b: B = ??? | ||
|
||
import ordA.given | ||
val _ = a > a | ||
|
||
import ordB.given | ||
val _ = b < b | ||
|
||
// unminimized OP | ||
trait Circular[T] extends Ordering[T] | ||
trait Turns[C: Circular, T] extends Ordering[T]: | ||
extension (turns: T) def extract: C | ||
|
||
def f[K, T](start: T, end: T)(using circular: Circular[K], turns: Turns[K, T]): Boolean = | ||
import turns.given | ||
if start > end then throw new IllegalArgumentException("start must be <= end") | ||
|
||
import circular.given | ||
start.extract < end.extract |
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 @@ | ||
//> using options -Wunused:imports | ||
|
||
import scala.deriving.Mirror | ||
|
||
case class Test(i: Int, d: Double) | ||
case class Decoder(d: Product => Test) | ||
|
||
// OK, no warning returned | ||
//val ok = Decoder(summon[Mirror.Of[Test]].fromProduct) | ||
// | ||
// returns warning: | ||
// [warn] unused import | ||
// [warn] import scala.deriving.Mirror | ||
val d = Decoder(d = summon[Mirror.Of[Test]].fromProduct) // no warn |