Skip to content

Commit 1e0d6be

Browse files
committed
Make synthetic function type members match non synthetic
1 parent a4f0d35 commit 1e0d6be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,11 @@ class Definitions {
114114
val cls = denot.asClass.classSymbol
115115
val decls = newScope
116116
val arity = name.functionArity
117+
val paramNamePrefix = tpnme.scala_ ++ str.NAME_JOIN ++ name ++ str.EXPAND_SEPARATOR
117118
val argParams =
118-
for (i <- List.range(0, arity)) yield
119-
enterTypeParam(cls, name ++ "$T" ++ i.toString, Contravariant, decls)
120-
val resParam = enterTypeParam(cls, name ++ "$R", Covariant, decls)
119+
for (i <- List.range(1, arity + 1)) yield
120+
enterTypeParam(cls, paramNamePrefix ++ "T" ++ i.toString, Contravariant, decls)
121+
val resParam = enterTypeParam(cls, paramNamePrefix ++ "R", Covariant, decls)
121122
val (methodType, parentTraits) =
122123
if (name.firstPart.startsWith(str.ImplicitFunction)) {
123124
val superTrait =

0 commit comments

Comments
 (0)