Skip to content

Commit abb3060

Browse files
committed
Make memberSignature work after erasure.
Erasure uncurries arguments, need to track that in memberSignature.
1 parent 4c5b14a commit abb3060

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/dotty/tools/dotc/transform/FullParameterization.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,18 @@ trait FullParameterization {
226226
}
227227

228228
object FullParameterization {
229+
229230
/** Assuming `info` is a result of a `fullyParameterizedType` call, the signature of the
230231
* original method type `X` such that `info = fullyParameterizedType(X, ...)`.
231232
*/
232233
def memberSignature(info: Type)(implicit ctx: Context): Signature = info match {
233-
case info: PolyType => memberSignature(info.resultType)
234-
case info @ MethodType(nme.SELF :: Nil, _) => info.resultType.ensureMethodic.signature
235-
case _ => Signature.NotAMethod
234+
case info: PolyType =>
235+
memberSignature(info.resultType)
236+
case info @ MethodType(nme.SELF :: Nil, _) =>
237+
info.resultType.ensureMethodic.signature
238+
case info @ MethodType(nme.SELF :: otherNames, thisType :: otherTypes) =>
239+
info.derivedMethodType(otherNames, otherTypes, info.resultType).signature
240+
case _ =>
241+
Signature.NotAMethod
236242
}
237243
}

0 commit comments

Comments
 (0)