File tree Expand file tree Collapse file tree 4 files changed +41
-5
lines changed
src/dotty/tools/dotc/printing Expand file tree Collapse file tree 4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,22 @@ object Formatting {
132132 alts = entry :: existing
133133 update(key, alts)
134134 }
135- str + " '" * (alts.length - 1 )
135+ val suffix = alts.length match {
136+ case 1 => " "
137+ case n => n.toString.toCharArray.map {
138+ case '0' => '⁰'
139+ case '1' => '¹'
140+ case '2' => '²'
141+ case '3' => '³'
142+ case '4' => '⁴'
143+ case '5' => '⁵'
144+ case '6' => '⁶'
145+ case '7' => '⁷'
146+ case '8' => '⁸'
147+ case '9' => '⁹'
148+ }.mkString
149+ }
150+ str + suffix
136151 }
137152 }
138153
Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var
33331 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
3434 | ^
3535 |Found: C.this.T(C.this.x)
36- |Required: T'
36+ |Required: T²
3737 |
3838 |where: T is a type in class C
39- | T' is a type in the initializer of value s which is an alias of String
39+ | T² is a type in the initializer of value s which is an alias of String
40401 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
4141 | ^
4242 |Found: T(y)
43- |Required: T'
43+ |Required: T²
4444 |
4545 |where: T is a type in the initializer of value s which is an alias of String
46- | T' is a type in method f which is an alias of Int
46+ | T² is a type in method f which is an alias of Int
4747scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
48481 | class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
4949 | ^^^^^^^^
Original file line number Diff line number Diff line change 1+ -- [E007] Type Mismatch Error: tests/neg/i7195.scala:10:8 --------------------------------------------------------------
2+ 10 | A.foo(??? : T) // error
3+ | ^^^^^^^
4+ | Found: B.T
5+ | Required: A.T²
6+ |
7+ | where: T is a type in object B
8+ | T² is a type in object A
Original file line number Diff line number Diff line change 1+ object A {
2+ type T
3+
4+ def foo (a : T ) = ()
5+
6+ }
7+
8+ object B {
9+ type T
10+ A .foo(??? : T ) // error
11+
12+
13+ }
You can’t perform that action at this time.
0 commit comments