Skip to content

Commit e89a66c

Browse files
Make context bounds for poly functions a standard feature (#22019)
closes #22017
1 parent 64411b6 commit e89a66c

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
@@ -3491,7 +3491,7 @@ object Parsers {
34913491
val hkparams = typeParamClauseOpt(ParamOwner.Hk)
34923492
val bounds =
34933493
if paramOwner.acceptsCtxBounds then typeAndCtxBounds(name)
3494-
else if in.featureEnabled(Feature.modularity) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
3494+
else if sourceVersion.isAtLeast(`3.6`) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
34953495
else typeBounds()
34963496
TypeDef(name, lambdaAbstract(hkparams, bounds)).withMods(mods)
34973497
}

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)