File tree Expand file tree Collapse file tree 7 files changed +30
-6
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 7 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,10 @@ class PlainPrinter(_ctx: Context) extends Printer {
404
404
case tp : ExprType =>
405
405
// parameterless methods require special treatment, see #11201
406
406
(if (isParameter) " : => " else " : " ) ~ toTextGlobal(tp.widenExpr)
407
+ case tp : PolyType =>
408
+ " [" ~ paramsText(tp) ~ " ]"
409
+ ~ (Str (" : " ) provided ! tp.resultType.isInstanceOf [MethodType ])
410
+ ~ toTextGlobal(tp.resultType)
407
411
case tp =>
408
412
" : " ~ toTextGlobal(tp)
409
413
}
Original file line number Diff line number Diff line change 1
1
-- Error: tests/neg/i10666.scala:8:6 -----------------------------------------------------------------------------------
2
2
8 |class Bar extends Foo { // error
3
3
| ^
4
- | class Bar needs to be abstract, since def foo: [T <: B](tx: T): Unit in trait Foo is not defined
4
+ | class Bar needs to be abstract, since def foo[T <: B](tx: T): Unit in trait Foo is not defined
5
5
| (Note that
6
- | parameter T in def foo: [T <: B](tx: T): Unit in trait Foo does not match
7
- | parameter T in def foo: [T <: A](tx: T): Unit in class Bar
6
+ | parameter T in def foo[T <: B](tx: T): Unit in trait Foo does not match
7
+ | parameter T in def foo[T <: A](tx: T): Unit in class Bar
8
8
| class B is a subclass of class A, but method parameter types must match exactly.)
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg/i13466.scala:9:6 -----------------------------------------------------------------------------------
2
+ 9 |given none: SomeTrait[Finally] with {} // error
3
+ | ^
4
+ | object creation impossible, since:
5
+ | it has 3 unimplemented members.
6
+ | /** As seen from module class none$, the missing signatures are as follows.
7
+ | * For convenience, these are usable as stub implementations.
8
+ | */
9
+ | def foo: Finally[Unit] = ???
10
+ | def withTV[A]: Finally[A] = ???
11
+ | def withTV2[A, B]: Finally[(A, B)] = ???
Original file line number Diff line number Diff line change
1
+ opaque type Finally [A ] = A
2
+
3
+ trait SomeTrait [F [_]] {
4
+ def foo : F [Unit ]
5
+ def withTV [A ]: F [A ]
6
+ def withTV2 [A , B ]: F [(A , B )]
7
+ }
8
+
9
+ given none : SomeTrait [Finally ] with {} // error
Original file line number Diff line number Diff line change 2
2
1 |trait SAMTrait: // error
3
3
| ^
4
4
| Name clash between inherited members:
5
- | def equals: [T >: Boolean <: Boolean](obj: Any): T in trait SAMTrait at line 3 and
5
+ | def equals[T >: Boolean <: Boolean](obj: Any): T in trait SAMTrait at line 3 and
6
6
| def equals(x$0: Any): Boolean in class Any
7
7
| have the same type after erasure.
8
8
|
Original file line number Diff line number Diff line change 3
3
| ^
4
4
| Name clash between inherited members:
5
5
| def concat(suffix: Int): X in trait One at line 4 and
6
- | def concat: [Dummy](suffix: Int): Y in trait Two at line 8
6
+ | def concat[Dummy](suffix: Int): Y in trait Two at line 8
7
7
| have the same type after erasure.
8
8
|
9
9
| Consider adding a @targetName annotation to one of the conflicting definitions
Original file line number Diff line number Diff line change 4
4
| ^
5
5
| Name clash between inherited members:
6
6
| def concat(suffix: Int): X in trait One at line 4 and
7
- | def concat: [Dummy](suffix: Int): Y in trait Two at line 8
7
+ | def concat[Dummy](suffix: Int): Y in trait Two at line 8
8
8
| have the same type after erasure.
9
9
|
10
10
| Consider adding a @targetName annotation to one of the conflicting definitions
You can’t perform that action at this time.
0 commit comments