Skip to content

Commit 1ba3d61

Browse files
committed
Fixes to comments suggested by reviewer
Fixes suggested by @marter when reviewing previous hk PR.
1 parent 71e3133 commit 1ba3d61

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TypeApplications(val self: Type) extends AnyVal {
137137
def isSafeLambda(implicit ctx: Context): Boolean =
138138
LambdaClass(forcing = false).exists
139139

140-
/** Is type `tp` a Lambda with all Arg$ fields fully instantiated? */
140+
/** Is type `tp` a Lambda with all hk$i fields fully instantiated? */
141141
def isInstantiatedLambda(implicit ctx: Context): Boolean =
142142
isSafeLambda && typeParams.isEmpty
143143

@@ -211,7 +211,7 @@ class TypeApplications(val self: Type) extends AnyVal {
211211
}
212212
case tp: RefinedType =>
213213
val redux = tp.EtaReduce
214-
if (redux.exists) redux.appliedTo(args) // Rewrite ([HK$0] => C[HK$0])(T) to C[T]
214+
if (redux.exists) redux.appliedTo(args) // Rewrite ([hk$0] => C[hk$0])(T) to C[T]
215215
else tp.derivedRefinedType(
216216
instantiate(tp.parent, original),
217217
tp.refinedName,
@@ -473,7 +473,7 @@ class TypeApplications(val self: Type) extends AnyVal {
473473
* - `bounds` consists of type declarations `type hk$i >: toHK(L) <: toHK(U),
474474
* one for each type parameter in `T` with non-trivial bounds L,U.
475475
* - `toHK` is a substitution that replaces every bound symbol sym_i by
476-
* `this.Arg$i`.
476+
* `this.hk$i`.
477477
*
478478
* TypeBounds are lambda abstracting by lambda abstracting their upper bound.
479479
*
@@ -516,7 +516,7 @@ class TypeApplications(val self: Type) extends AnyVal {
516516

517517
/** Convert a type constructor `TC` with type parameters `T1, ..., Tn` to
518518
*
519-
* LambdaXYZ { Apply = TC[$hkArg$0, ..., $hkArg$n] }
519+
* LambdaXYZ { Apply = TC[hk$0, ..., hk$n] }
520520
*
521521
* where XYZ is a corresponds to the variances of the type parameters.
522522
*/
@@ -617,8 +617,8 @@ class TypeApplications(val self: Type) extends AnyVal {
617617
* the type parameters of `B` match one-by-one the variances of `tparams`,
618618
* and where the lambda abstracted type
619619
*
620-
* LambdaXYZ { type Apply = B[$hkArg$0, ..., $hkArg${n-1}] }
621-
* { type $hkArg$0 = T1; ...; type $hkArg${n-1} = Tn }
620+
* LambdaXYZ { type Apply = B[hk$0, ..., hk${n-1}] }
621+
* { type hk$0 = T1; ...; type hk${n-1} = Tn }
622622
*
623623
* satisfies predicate `p`. Try base types in the order of their occurrence in `baseClasses`.
624624
* A type parameter matches a variance V if it has V as its variance or if V == 0.

tests/pos/partialApplications.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ object Test {
3131
object Test2 {
3232
type Histogram = Map[_, Int]
3333

34-
type StringlyHistogram = Histogram[_ >: String] // error
34+
type StringlyHistogram = Histogram[_ >: String]
3535

36-
val xs: Histogram[String] = Map[String, Int]() // error
36+
val xs: Histogram[String] = Map[String, Int]()
3737

38-
val ys: StringlyHistogram[String] = xs // error
38+
val ys: StringlyHistogram[String] = xs
3939

40-
val zs: StringlyHistogram = xs // error
40+
val zs: StringlyHistogram = xs
4141

4242
val xs1 = xs
4343
val ys1 = ys

0 commit comments

Comments
 (0)