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 {
404404 case tp : ExprType =>
405405 // parameterless methods require special treatment, see #11201
406406 (if (isParameter) " : => " else " : " ) ~ toTextGlobal(tp.widenExpr)
407+ case tp : PolyType =>
408+ " [" ~ paramsText(tp) ~ " ]"
409+ ~ (Str (" : " ) provided ! tp.resultType.isInstanceOf [MethodType ])
410+ ~ toTextGlobal(tp.resultType)
407411 case tp =>
408412 " : " ~ toTextGlobal(tp)
409413 }
Original file line number Diff line number Diff line change 11-- Error: tests/neg/i10666.scala:8:6 -----------------------------------------------------------------------------------
228 |class Bar extends Foo { // error
33 | ^
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
55 | (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
88 | 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 221 |trait SAMTrait: // error
33 | ^
44 | 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
66 | def equals(x$0: Any): Boolean in class Any
77 | have the same type after erasure.
88 |
Original file line number Diff line number Diff line change 33 | ^
44 | Name clash between inherited members:
55 | 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
77 | have the same type after erasure.
88 |
99 | Consider adding a @targetName annotation to one of the conflicting definitions
Original file line number Diff line number Diff line change 44 | ^
55 | Name clash between inherited members:
66 | 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
88 | have the same type after erasure.
99 |
1010 | Consider adding a @targetName annotation to one of the conflicting definitions
You can’t perform that action at this time.
0 commit comments