-
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.
Set default source version to 3.5 (#20435)
The main part of this branch was superseded by #20441, but there were a couple of tests to add, and also a change in the treatment of looping implicits in 3.6
- Loading branch information
Showing
4 changed files
with
36 additions
and
1 deletion.
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,2 @@ | ||
class Foo: | ||
given ord: Ordering[Int] = summon[Ordering[Int]] // 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,19 @@ | ||
//> using options -Xfatal-warnings -source 3.4 | ||
|
||
trait Monad[T]: | ||
def id: String | ||
class Foo | ||
object Foo { | ||
given Monad[Foo] with { def id = "Foo" } | ||
} | ||
|
||
opaque type Bar = Foo | ||
object Bar { | ||
given Monad[Bar] = summon[Monad[Foo]] // warn | ||
} | ||
|
||
object Test extends App { | ||
println(summon[Monad[Foo]].id) | ||
println(summon[Monad[Bar]].id) | ||
} | ||
// nopos-error: No warnings can be incurred under -Werror (or -Xfatal-warnings) |
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 -Xfatal-warnings -source 3.4 | ||
|
||
class Foo | ||
|
||
object Bar { | ||
given Foo with {} | ||
given List[Foo] = List(summon[Foo]) // ok | ||
} | ||
|
||
object Baz { | ||
@annotation.nowarn | ||
given List[Foo] = List(summon[Foo]) // gives a warning, which is suppressed | ||
given Foo with {} | ||
} |