File tree 3 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc
3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ object NameOps {
124
124
name.rewrite { case ExpandedName (_, unexp) => unexp }
125
125
}
126
126
127
+ /** Remove the variance from the name. */
128
+ def invariantName : N = likeSpaced {
129
+ name.rewrite { case VariantName (invariant, _) => invariant }
130
+ }
131
+
127
132
def implClassName : N = likeSpaced(name ++ tpnme.IMPL_CLASS_SUFFIX )
128
133
129
134
def errorName : N = likeSpaced(name ++ nme.ERROR )
Original file line number Diff line number Diff line change @@ -635,7 +635,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
635
635
if (tree.exists(! _.isEmpty)) encl(blockText(tree)) else " "
636
636
637
637
override protected def ParamRefNameString (name : Name ): String =
638
- name.unexpandedName.toString
638
+ name.unexpandedName.invariantName. toString
639
639
640
640
override protected def treatAsTypeParam (sym : Symbol ): Boolean = sym is TypeParam
641
641
Original file line number Diff line number Diff line change 1
1
scala> case class Foo[M[_]](x: M[Int])
2
2
defined class Foo
3
3
scala> Foo(Option(1))
4
- val res0: Foo[[+A] => Option[+ A]] = Foo(Some(1))
4
+ val res0: Foo[[+A] => Option[A]] = Foo(Some(1))
5
5
scala> :quit
You can’t perform that action at this time.
0 commit comments