Skip to content

Commit d0625ab

Browse files
committed
Remove refinement encoding of hk types
Remove the code that implemented the encoding of hk types using refinements.
1 parent 4377aaa commit d0625ab

File tree

11 files changed

+30
-549
lines changed

11 files changed

+30
-549
lines changed

src/dotty/tools/dotc/config/Config.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ object Config {
1010

1111
final val checkCacheMembersNamed = false
1212

13-
final val newHK = true
14-
1513
/** When updating a constraint bound, check that the constrained parameter
1614
* does not appear at the top-level of either of its bounds.
1715
*/

src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ trait ConstraintHandling {
286286
if (!addParamBound(bound)) NoType
287287
else if (fromBelow) defn.NothingType
288288
else defn.AnyType
289-
case bound: RefinedType if !Config.newHK =>
290-
bound.normalizeHkApplyOLD
291289
case _ =>
292290
bound
293291
}

src/dotty/tools/dotc/core/NameOps.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,6 @@ object NameOps {
100100
name.length > 0 && name.last == '=' && name.head != '=' && isOperatorPart(name.head)
101101
}
102102

103-
/** Is this the name of a higher-kinded type parameter of a Lambda? */
104-
def isHkArgNameOLD =
105-
name.length > 0 &&
106-
name.head == tpnme.hkArgPrefixHeadOLD &&
107-
name.startsWith(tpnme.hkArgPrefixOLD) && {
108-
val digits = name.drop(tpnme.hkArgPrefixLengthOLD)
109-
digits.length <= 4 && digits.forall(_.isDigit)
110-
}
111-
112-
/** The index of the higher-kinded type parameter with this name.
113-
* Pre: isLambdaArgName.
114-
*/
115-
def hkArgIndexOLD: Int =
116-
name.drop(tpnme.hkArgPrefixLengthOLD).toString.toInt
117-
118103
/** If the name ends with $nn where nn are
119104
* all digits, strip the $ and the digits.
120105
* Otherwise return the argument.

src/dotty/tools/dotc/core/StdNames.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,10 +529,6 @@ object StdNames {
529529

530530
val synthSwitch: N = "$synthSwitch"
531531

532-
val hkArgPrefixOLD: N = "$hk"
533-
val hkArgPrefixHeadOLD: Char = hkArgPrefixOLD.head
534-
val hkArgPrefixLengthOLD: Int = hkArgPrefixOLD.length
535-
536532
// unencoded operators
537533
object raw {
538534
final val AMP : N = "&"
@@ -746,8 +742,6 @@ object StdNames {
746742
def syntheticLambdaParamNames(num: Int): List[TypeName] =
747743
(0 until num).map(syntheticLambdaParamName)(breakOut)
748744

749-
def hkArgOLD(n: Int): TypeName = hkArgPrefixOLD ++ n.toString
750-
751745
final val Conforms = encode("<:<")
752746
}
753747

0 commit comments

Comments
 (0)