File tree 3 files changed +35
-4
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -1452,10 +1452,11 @@ class Namer { typer: Typer =>
1452
1452
forwarders.derivedCons(forwarder2, avoidClashes(forwarders2))
1453
1453
case Nil => forwarders
1454
1454
1455
- addForwarders(selectors, Nil )
1456
- val forwarders = avoidClashes(buf.toList)
1457
- exp.pushAttachment(ExportForwarders , forwarders)
1458
- forwarders
1455
+ exp.getAttachment(ExportForwarders ).getOrElse:
1456
+ addForwarders(selectors, Nil )
1457
+ val forwarders = avoidClashes(buf.toList)
1458
+ exp.pushAttachment(ExportForwarders , forwarders)
1459
+ forwarders
1459
1460
end exportForwarders
1460
1461
1461
1462
/** Add forwarders as required by the export statements in this class */
Original file line number Diff line number Diff line change
1
+ -- [E051] Reference Error: tests/neg/i21071.scala:9:2 ------------------------------------------------------------------
2
+ 9 | foo { // error
3
+ | ^^^
4
+ | Ambiguous overload. The overloaded alternatives of method foo in object MySuite with types
5
+ | (a: String): Nothing
6
+ | (a: List[String]): Nothing
7
+ | both match arguments ((??? : => Nothing))
8
+ |
9
+ | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ trait Service {
2
+ def method : String
3
+ }
4
+
5
+ object MySuite {
6
+ def foo (a : List [String ]) = ???
7
+ def foo (a : String ) = ???
8
+
9
+ foo { // error
10
+
11
+ new Service {
12
+ private val underlying : Service = ???
13
+ private val s = " foo"
14
+
15
+ export underlying .*
16
+ export s .toLowerCase
17
+ }
18
+
19
+ ???
20
+ }
21
+ }
You can’t perform that action at this time.
0 commit comments