@@ -178,20 +178,17 @@ class TypeApplications(val self: Type) extends AnyVal {
178
178
if (tsym.isClass) tsym.typeParams
179
179
else if (! tsym.isCompleting) tsym.info.typeParams
180
180
else Nil
181
+ case self : AppliedType =>
182
+ if (self.tycon.typeSymbol.isClass) Nil
183
+ else self.superType.typeParams
181
184
case self : ClassInfo =>
182
185
self.cls.typeParams
183
186
case self : HKTypeLambda =>
184
187
self.typeParams
185
- case self : RefinedType =>
186
- self.parent.typeParams
187
- case self : RecType =>
188
- self.parent.typeParams
189
- case _ : SingletonType =>
188
+ case _ : SingletonType | _ : RefinedType | _ : RecType =>
190
189
Nil
191
190
case self : WildcardType =>
192
191
self.optBounds.typeParams
193
- case self : AppliedType if self.tycon.typeSymbol.isClass =>
194
- Nil
195
192
case self : TypeProxy =>
196
193
self.superType.typeParams
197
194
case _ =>
@@ -217,15 +214,15 @@ class TypeApplications(val self: Type) extends AnyVal {
217
214
/** If self type is higher-kinded, its result type, otherwise NoType */
218
215
def hkResult (implicit ctx : Context ): Type = self.dealias match {
219
216
case self : TypeRef => self.info.hkResult
220
- case self : RefinedType => NoType
221
- case self : AppliedType => NoType
217
+ case self : AppliedType =>
218
+ if (self.tycon.typeSymbol.isClass) NoType else self.superType.hkResult
222
219
case self : HKTypeLambda => self.resultType
223
- case self : SingletonType => NoType
220
+ case _ : SingletonType | _ : RefinedType | _ : RecType => NoType
221
+ case self : WildcardType => self.optBounds.hkResult
224
222
case self : TypeVar =>
225
223
// Using `origin` instead of `underlying`, as is done for typeParams,
226
224
// avoids having to set ephemeral in some cases.
227
225
self.origin.hkResult
228
- case self : WildcardType => self.optBounds.hkResult
229
226
case self : TypeProxy => self.superType.hkResult
230
227
case _ => NoType
231
228
}
0 commit comments