Skip to content

Commit

Permalink
Adjust more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Nov 6, 2024
1 parent 57347d8 commit ac3f5dc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
6 changes: 2 additions & 4 deletions tests/pos/i17314.scala → tests/warn/i17314.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -Wunused:all -deprecation -feature
//> using options -Wunused:all -deprecation -feature

import java.net.URI

Expand All @@ -10,9 +10,7 @@ object circelike {
type Configuration
trait ConfiguredCodec[T]
object ConfiguredCodec:
inline final def derived[A](using conf: Configuration)(using
inline mirror: Mirror.Of[A]
): ConfiguredCodec[A] =
inline final def derived[A](using conf: Configuration)(using inline mirror: Mirror.Of[A]): ConfiguredCodec[A] = // warn // warn
class InlinedConfiguredCodec extends ConfiguredCodec[A]:
val codec = summonInline[Codec[URI]] // simplification
new InlinedConfiguredCodec
Expand Down
2 changes: 1 addition & 1 deletion tests/pos/i17314a.scala → tests/warn/i17314a.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Xfatal-warnings -Wunused:all -deprecation -feature
//> using options -Wunused:all -deprecation -feature

package foo:
class Foo[T]
Expand Down
2 changes: 1 addition & 1 deletion tests/warn/i17314b.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using options -Wunused:all
//> using options -Wunused:all

package foo:
class Foo[T]
Expand Down
22 changes: 11 additions & 11 deletions tests/warn/scala2-t11681.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait BadAPI extends InterFace {
a
}
override def call(a: Int,
b: String, // OK
b: String, // warn now
c: Double): Int = {
println(c)
a
Expand All @@ -33,7 +33,7 @@ trait BadAPI extends InterFace {

override def equals(other: Any): Boolean = true // OK

def i(implicit s: String) = answer // ok
def i(implicit s: String) = answer // warn now

/*
def future(x: Int): Int = {
Expand Down Expand Up @@ -62,7 +62,7 @@ case class CaseyKasem(k: Int) // OK
case class CaseyAtTheBat(k: Int)(s: String) // ok

trait Ignorance {
def f(readResolve: Int) = answer // ok
def f(readResolve: Int) = answer // warn now
}

class Reusing(u: Int) extends Unusing(u) // OK
Expand All @@ -78,30 +78,30 @@ trait Unimplementation {

trait DumbStuff {
def f(implicit dummy: DummyImplicit) = answer // ok
def g(dummy: DummyImplicit) = answer // ok
def g(dummy: DummyImplicit) = answer // warn now
}
trait Proofs {
def f[A, B](implicit ev: A =:= B) = answer // ok
def g[A, B](implicit ev: A <:< B) = answer // ok
def f2[A, B](ev: A =:= B) = answer // ok
def g2[A, B](ev: A <:< B) = answer // ok
def f2[A, B](ev: A =:= B) = answer // warn now
def g2[A, B](ev: A <:< B) = answer // warn now
}

trait Anonymous {
def f = (i: Int) => answer // ok
def f = (i: Int) => answer // warn now

def f1 = (_: Int) => answer // OK

def f2: Int => Int = _ + 1 // OK

def g = for (i <- List(1)) yield answer // ok
def g = for (i <- List(1)) yield answer // warn
}
trait Context[A]
trait Implicits {
def f[A](implicit ctx: Context[A]) = answer // ok
def g[A: Context] = answer // OK
def f[A](implicit ctx: Context[A]) = answer // warn
def g[A: Context] = answer // warn
}
class Bound[A: Context] // OK
class Bound[A: Context] // warn
object Answers {
def answer: Int = 42
}
Expand Down

0 comments on commit ac3f5dc

Please sign in to comment.