Skip to content

Commit 8814f7c

Browse files
Backport "Make context bounds for poly functions a standard feature" to 3.6 (#22024)
Backports #22019 to the 3.6.2. PR submitted by the release tooling. [skip ci] Co-authored-by: Kacper Korban <[email protected]>
1 parent 236cb8a commit 8814f7c

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

Diff for: compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3492,7 +3492,7 @@ object Parsers {
34923492
val hkparams = typeParamClauseOpt(ParamOwner.Hk)
34933493
val bounds =
34943494
if paramOwner.acceptsCtxBounds then typeAndCtxBounds(name)
3495-
else if in.featureEnabled(Feature.modularity) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
3495+
else if sourceVersion.isAtLeast(`3.6`) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
34963496
else typeBounds()
34973497
TypeDef(name, lambdaAbstract(hkparams, bounds)).withMods(mods)
34983498
}

Diff for: tests/pos/contextbounds-for-poly-functions.scala

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import scala.language.experimental.modularity
2-
import scala.language.future
3-
41
trait Ord[X]:
52
def compare(x: X, y: X): Int
63
type T

Diff for: tests/run/contextbounds-for-poly-functions.scala

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import scala.language.experimental.modularity
2-
import scala.language.future
3-
41
trait Show[X]:
52
def show(x: X): String
63

0 commit comments

Comments
 (0)