File tree 4 files changed +41
-5
lines changed
src/dotty/tools/dotc/printing
4 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,22 @@ object Formatting {
132
132
alts = entry :: existing
133
133
update(key, alts)
134
134
}
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
136
151
}
137
152
}
138
153
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
33
33
1 | 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() } }; }
34
34
| ^
35
35
|Found: C.this.T(C.this.x)
36
- |Required: T'
36
+ |Required: T²
37
37
|
38
38
|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
40
40
1 | 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() } }; }
41
41
| ^
42
42
|Found: T(y)
43
- |Required: T'
43
+ |Required: T²
44
44
|
45
45
|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
47
47
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
48
48
1 | class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
49
49
| ^^^^^^^^
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