Skip to content

Commit 188ff60

Browse files
Merge pull request #9558 from dotty-staging/fix-#6183
Fix #6183: Add regression test
2 parents 020f5a1 + 8b59f89 commit 188ff60

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/neg/i6183.check

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- [E008] Not Found Error: tests/neg/i6183.scala:5:5 -------------------------------------------------------------------
2+
5 | 42.render // error
3+
| ^^^^^^^^^
4+
| value render is not a member of Int.
5+
| An extension method was tried, but could not be fully constructed:
6+
|
7+
| extension_render(42)
8+
-- [E051] Reference Error: tests/neg/i6183.scala:6:2 -------------------------------------------------------------------
9+
6 | extension_render(42) // error
10+
| ^^^^^^^^^^^^^^^^
11+
| Ambiguous overload. The overloaded alternatives of method extension_render with types
12+
| [B](b: B)(using x$1: DummyImplicit): Char
13+
| [A](a: A): String
14+
| both match arguments ((42 : Int))
15+
16+
longer explanation available when compiling with `-explain`

tests/neg/i6183.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extension [A](a: A) def render: String = "Hi"
2+
extension [B](b: B) def render(using DummyImplicit): Char = 'x'
3+
4+
val test = {
5+
42.render // error
6+
extension_render(42) // error
7+
}

0 commit comments

Comments
 (0)