Skip to content

Commit a2a445f

Browse files
committed
Fix signature for hk type lambdas
The had the same signature as polymorphic types, but being a type of types, they should have signature NotAMethod
1 parent 71bf783 commit a2a445f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,7 +2465,7 @@ object Types {
24652465
extends CachedProxyType with TermType with MethodicType {
24662466
override def resultType(implicit ctx: Context): Type = resType
24672467
override def underlying(implicit ctx: Context): Type = resType
2468-
protected def computeSignature(implicit ctx: Context): Signature = resultSignature
2468+
def computeSignature(implicit ctx: Context): Signature = resultSignature
24692469
def derivedExprType(resType: Type)(implicit ctx: Context) =
24702470
if (resType eq this.resType) this else ExprType(resType)
24712471
override def computeHash = doHash(resType)
@@ -2487,7 +2487,7 @@ object Types {
24872487
* HKLambda | HKTermLambda | HKTypeLambda
24882488
* MethodOrPoly | MethodType | PolyType
24892489
*/
2490-
trait LambdaType extends BindingType with MethodicType { self =>
2490+
trait LambdaType extends BindingType with TermType { self =>
24912491
type ThisName <: Name
24922492
type PInfo <: Type
24932493
type This <: LambdaType{type PInfo = self.PInfo}
@@ -2517,8 +2517,6 @@ object Types {
25172517
myParamRefs
25182518
}
25192519

2520-
protected def computeSignature(implicit ctx: Context) = resultSignature
2521-
25222520
final def instantiate(argTypes: => List[Type])(implicit ctx: Context): Type =
25232521
if (isDependent) resultType.substParams(this, argTypes)
25242522
else resultType
@@ -2566,7 +2564,7 @@ object Types {
25662564
}
25672565
}
25682566

2569-
abstract class MethodOrPoly extends CachedGroundType with LambdaType with TermType {
2567+
abstract class MethodOrPoly extends CachedGroundType with LambdaType with MethodicType {
25702568
final override def computeHash = doHash(paramNames, resType, paramInfos)
25712569

25722570
// Defined here instead of in LambdaType for efficiency
@@ -2691,7 +2689,7 @@ object Types {
26912689
val resType = resultTypeExp(this)
26922690
assert(resType.exists)
26932691

2694-
override def computeSignature(implicit ctx: Context): Signature =
2692+
def computeSignature(implicit ctx: Context): Signature =
26952693
resultSignature.prepend(paramInfos, isJava)
26962694

26972695
protected def prefixString = "MethodType"
@@ -2895,6 +2893,8 @@ object Types {
28952893
assert(resType.isInstanceOf[TermType], this)
28962894
assert(paramNames.nonEmpty)
28972895

2896+
def computeSignature(implicit ctx: Context) = resultSignature
2897+
28982898
/** Merge nested polytypes into one polytype. nested polytypes are normally not supported
28992899
* but can arise as temporary data structures.
29002900
*/

0 commit comments

Comments
 (0)