Skip to content

Commit

Permalink
Don't require experimental modularity feature for context bounds for …
Browse files Browse the repository at this point in the history
…poly-functions (SIP-64)
  • Loading branch information
WojciechMazur committed Nov 25, 2024
1 parent 64411b6 commit 3fee2de
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3491,7 +3491,7 @@ object Parsers {
val hkparams = typeParamClauseOpt(ParamOwner.Hk)
val bounds =
if paramOwner.acceptsCtxBounds then typeAndCtxBounds(name)
else if in.featureEnabled(Feature.modularity) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
else if sourceVersion.isAtLeast(`3.6`) && paramOwner == ParamOwner.Type then typeAndCtxBounds(name)
else typeBounds()
TypeDef(name, lambdaAbstract(hkparams, bounds)).withMods(mods)
}
Expand Down
3 changes: 0 additions & 3 deletions tests/pos/contextbounds-for-poly-functions.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import scala.language.experimental.modularity
import scala.language.future

trait Ord[X]:
def compare(x: X, y: X): Int
type T
Expand Down
3 changes: 0 additions & 3 deletions tests/run/contextbounds-for-poly-functions.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import scala.language.experimental.modularity
import scala.language.future

trait Show[X]:
def show(x: X): String

Expand Down

0 comments on commit 3fee2de

Please sign in to comment.