-
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.
Avoid cyclic errors forcing default arg types
- Loading branch information
1 parent
27a4d8f
commit eb5c3e8
Showing
5 changed files
with
16 additions
and
8 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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
-- [E172] Type Error: tests/neg/given-ambiguous-default-2.scala:18:23 -------------------------------------------------- | ||
18 |def f: Unit = summon[C] // error: Ambiguous given instances | ||
| ^ | ||
|No best given instance of type C was found for parameter x of method summon in object Predef. | ||
|I found: | ||
| No best given instance of type C was found for parameter x of method summon in object Predef. | ||
| I found: | ||
| | ||
| given_C(a = /* ambiguous: both given instance a1 and given instance a2 match type A */summon[A], this.given_C$default$2) | ||
| given_C(a = /* ambiguous: both given instance a1 and given instance a2 match type A */summon[A]) | ||
| | ||
|But both given instance a1 and given instance a2 match type A. | ||
| But both given instance a1 and given instance a2 match type A. |
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,6 @@ | ||
class Lang(name: String) | ||
object Lang { | ||
val Default = Lang("") | ||
def apply(language: String): Lang = ??? | ||
def apply(maybeLang: Option[String], default: Lang = Default): Lang = ??? | ||
} |