-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reject derived with explicit term params
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- Error: tests/neg/7722.scala:2:40 ------------------------------------------------------------------------------------ | ||
2 | @scala.annotation.targetName("E") def this() = this(3) // error | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| @targetName annotation may not be used on a constructor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import scala.language.experimental.clauseInterleaving | ||
|
||
trait ShowWithExplicit[A] | ||
|
||
object ShowWithExplicit: | ||
def derived[A, B](explicit: String)(using DummyImplicit)(implicit dummy: DummyImplicit): ShowWithExplicit[A] = ??? | ||
|
||
trait ShowUsingAndImplicit[A] | ||
|
||
object ShowUsingAndImplicit: | ||
def derived[A, B](using DummyImplicit)(implicit dummy: DummyImplicit): ShowUsingAndImplicit[A] = ??? | ||
|
||
trait ShowUsing[A] | ||
|
||
object ShowUsing: | ||
def derived[A](using DummyImplicit): ShowUsing[A] = ??? | ||
|
||
trait ShowImplicit[A] | ||
|
||
object ShowImplicit: | ||
def derived[A](implicit ev: DummyImplicit): ShowImplicit[A] = ??? | ||
|
||
trait ShowContra[-A] | ||
|
||
object ShowContra: | ||
val derived: ShowContra[Any] = ??? | ||
|
||
case class Person(name: String) derives ShowWithExplicit, // error | ||
ShowUsingAndImplicit, | ||
ShowUsing, | ||
ShowImplicit, | ||
ShowContra |