We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6062192 commit 882b435Copy full SHA for 882b435
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -103,6 +103,7 @@ object Typer {
103
*/
104
private[typer] def isSyntheticApply(tree: tpd.Tree): Boolean = tree match {
105
case tree: tpd.Select => tree.hasAttachment(InsertedApply)
106
+ case TypeApply(fn, _) => isSyntheticApply(fn)
107
case _ => false
108
}
109
tests/neg/i15567.scala
@@ -0,0 +1,9 @@
1
+object Test:
2
+ object Foo { def apply[A]: Foo.type = this }
3
+ Foo() // error
4
+
5
+ case class Bar() { def apply[A]: Bar = this }
6
+ Bar()() // error
7
8
+ case class Qux() { def apply[F[_]]: Qux = this }
9
+ Qux()() // error
0 commit comments