File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ object NameOps {
124124 name.rewrite { case ExpandedName (_, unexp) => unexp }
125125 }
126126
127+ /** Remove the variance from the name. */
128+ def invariantName : N = likeSpaced {
129+ name.rewrite { case VariantName (invariant, _) => invariant }
130+ }
131+
127132 def implClassName : N = likeSpaced(name ++ tpnme.IMPL_CLASS_SUFFIX )
128133
129134 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) {
635635 if (tree.exists(! _.isEmpty)) encl(blockText(tree)) else " "
636636
637637 override protected def ParamRefNameString (name : Name ): String =
638- name.unexpandedName.toString
638+ name.unexpandedName.invariantName. toString
639639
640640 override protected def treatAsTypeParam (sym : Symbol ): Boolean = sym is TypeParam
641641
Original file line number Diff line number Diff line change 11scala> case class Foo[M[_]](x: M[Int])
22defined class Foo
33scala> Foo(Option(1))
4- val res0: Foo[[+A] => Option[+ A]] = Foo(Some(1))
4+ val res0: Foo[[+A] => Option[A]] = Foo(Some(1))
55scala> :quit
You can’t perform that action at this time.
0 commit comments