New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Scala-3-style implicit resolution explicitly opt-in rather than bundled in -Xsource:3
#10012
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -903,9 +903,9 @@ trait Infer extends Checkable { | |
isAsSpecificValueType(rtpe1, tpe2, undef1 ::: tparams1, undef2) | ||
case _ => | ||
tpe2 match { | ||
case PolyType(tparams2, rtpe2) => isAsSpecificValueType(tpe1, rtpe2, undef1, undef2 ::: tparams2) | ||
case _ if !currentRun.isScala3 => existentialAbstraction(undef1, tpe1) <:< existentialAbstraction(undef2, tpe2) | ||
case _ => | ||
case PolyType(tparams2, rtpe2) => isAsSpecificValueType(tpe1, rtpe2, undef1, undef2 ::: tparams2) | ||
case _ if !currentRun.isScala3ImplicitResolution => existentialAbstraction(undef1, tpe1) <:< existentialAbstraction(undef2, tpe2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This incurs the implicit conversion. I wonder why I don't see a warning currently. Edit: I catch this in that PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw your comment and I was going to quickly make a change to avoid the conversion but upon checking out the most recent code I realized the conversion doesn't happen anymore with your change 0d252f6#diff-7b7600384a160cb93e5eceff814f6aed9f5c7b72b752a18c3f61d895482e75fcR907 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for checking my check. (That's what I meant by I caught it in my PR, which was about the same time as yours.) I might change them to vars, except there were a lot of |
||
case _ => | ||
// Backport of fix for https://github.com/scala/bug/issues/2509 | ||
// from Dotty https://github.com/lampepfl/dotty/commit/89540268e6c49fb92b9ca61249e46bb59981bf5a | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
class A | ||
class B extends A | ||
class C extends B | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
class A | ||
class B extends A | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
class Both[-A, +B] | ||
|
||
trait Factory[A] { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
class A | ||
class B extends A | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
|
||
class Both[-A, +B] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// scalac: -Xsource:3.0 | ||
// scalac: -Yscala3-implicit-resolution | ||
class A | ||
class B extends A | ||
class C extends B | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a
BooleanSetting
, not aBoolean
.