-
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.
activate constrainResult fix in 3.4 (#19253)
fixes #18174
- Loading branch information
Showing
4 changed files
with
42 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,12 @@ | ||
-- [E172] Type Error: tests/neg-macros/i18174.scala:27:33 -------------------------------------------------------------- | ||
27 | (charClassIntersection.rep() | classItem.rep()) // error | ||
| ^^^^^^^^^^^^^^^ | ||
|No given instance of type pkg.Implicits.Repeater[pkg.RegexTree, V] was found. | ||
|I found: | ||
| | ||
| pkg.Implicits.Repeater.GenericRepeaterImplicit[T] | ||
| | ||
|But method GenericRepeaterImplicit in object Repeater does not match type pkg.Implicits.Repeater[pkg.RegexTree, V] | ||
| | ||
|where: V is a type variable with constraint <: Seq[pkg.CharClassIntersection] | ||
|. |
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,27 @@ | ||
// does not compile anymore in Scala 3.4+ | ||
package pkg | ||
|
||
import scala.language.`3.4` | ||
|
||
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()) // 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