File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ object ProtoTypes {
117117 def constrainResult (meth : Symbol , mt : Type , pt : Type )(using Context ): Boolean =
118118 if (Inlines .isInlineable(meth)) {
119119 // Stricter behaviour in 3.4+: do not apply `wildApprox` to non-transparent inlines
120- if (Feature .sourceVersion.isAtLeast(SourceVersion .future )) {
120+ if (Feature .sourceVersion.isAtLeast(SourceVersion .`3.4` )) {
121121 if (meth.is(Transparent )) {
122122 constrainResult(mt, wildApprox(pt))
123123 // do not constrain the result type of transparent inline methods
Original file line number Diff line number Diff line change 1+ -- [E172] Type Error: tests/neg-macros/i18174.scala:27:33 --------------------------------------------------------------
2+ 27 | (charClassIntersection.rep() | classItem.rep()) // error
3+ | ^^^^^^^^^^^^^^^
4+ |No given instance of type pkg.Implicits.Repeater[pkg.RegexTree, V] was found.
5+ |I found:
6+ |
7+ | pkg.Implicits.Repeater.GenericRepeaterImplicit[T]
8+ |
9+ |But method GenericRepeaterImplicit in object Repeater does not match type pkg.Implicits.Repeater[pkg.RegexTree, V]
10+ |
11+ |where: V is a type variable with constraint <: Seq[pkg.CharClassIntersection]
12+ |.
Original file line number Diff line number Diff line change 1+ // does not compile anymore in Scala 3.4+
2+ package pkg
3+
4+ import scala .language .`3.4`
5+
6+ trait P [+ T ]
7+
8+ extension [T ](inline parse0 : P [T ])
9+ inline def | [V >: T ](inline other : P [V ]): P [V ] = ???
10+
11+ extension [T ](inline parse0 : => P [T ])
12+ inline def rep [V ](inline min : Int = 0 )(using repeater : Implicits .Repeater [T , V ]): P [V ] = ???
13+
14+ object Implicits :
15+ trait Repeater [- T , R ]
16+ object Repeater :
17+ implicit def GenericRepeaterImplicit [T ]: Repeater [T , Seq [T ]] = ???
18+
19+ sealed trait RegexTree
20+ abstract class Node extends RegexTree
21+ class CharClassIntersection () extends Node
22+
23+ def classItem : P [RegexTree ] = ???
24+ def charClassIntersection : P [CharClassIntersection ] = ???
25+
26+ def x =
27+ (charClassIntersection.rep() | classItem.rep()) // error
Original file line number Diff line number Diff line change 11// may not compile anymore in Scala 3.4+
22package pkg
33
4+ import scala .language .`3.3`
5+
46trait P [+ T ]
57
68extension [T ](inline parse0 : P [T ])
You can’t perform that action at this time.
0 commit comments