forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust the fix for scala#9685 to increase source compatibility.
We apply the full fix under `-source future` only, and a partial fix otherwise. This is a followup of scala#17924 that fixes the source incompatibilities reported in scala#18123. We test that the behavior under `-source future` still fixes scala#9685, and that without `-source future` we fix both scala#9685 and scala#18123.
- Loading branch information
Showing
5 changed files
with
75 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
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,9 @@ | ||
-- [E008] Not Found Error: tests/neg-macros/i9685bis.scala:23:4 -------------------------------------------------------- | ||
23 | 1.asdf // error | ||
| ^^^^^^ | ||
| value asdf is not a member of Int, but could be made available as an extension method. | ||
| | ||
| The following import might make progress towards fixing the problem: | ||
| | ||
| import foo.Baz.toBaz | ||
| |
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,23 @@ | ||
package foo | ||
|
||
import scala.language.implicitConversions | ||
|
||
class Foo | ||
|
||
object Foo: | ||
|
||
inline implicit def toFoo(x: Int): Foo = Foo() | ||
|
||
class Bar | ||
|
||
object Bar: | ||
inline given Conversion[Int, Bar] with | ||
def apply(x: Int): Bar = Bar() | ||
|
||
class Baz | ||
|
||
object Baz: | ||
transparent inline implicit def toBaz(x: Int): Baz = Baz() | ||
|
||
object Usage: | ||
1.asdf // 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,25 @@ | ||
// may not compile anymore in Scala 3.4+ | ||
package pkg | ||
|
||
trait P[+T] | ||
|
||
extension [T](inline parse0: P[T]) | ||
inline def | [V >: T](inline other: P[V]): P[V] = ??? | ||
|
||
extension [T](inline parse0: => P[T]) | ||
inline def rep[V](inline min: Int = 0)(using repeater: Implicits.Repeater[T, V]): P[V] = ??? | ||
|
||
object Implicits: | ||
trait Repeater[-T, R] | ||
object Repeater: | ||
implicit def GenericRepeaterImplicit[T]: Repeater[T, Seq[T]] = ??? | ||
|
||
sealed trait RegexTree | ||
abstract class Node extends RegexTree | ||
class CharClassIntersection() extends Node | ||
|
||
def classItem: P[RegexTree] = ??? | ||
def charClassIntersection: P[CharClassIntersection] = ??? | ||
|
||
def x = | ||
(charClassIntersection.rep() | classItem.rep()) |