File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1364,9 +1364,9 @@ class Objects(using Context @constructorOnly):
1364
1364
case UnknownValue =>
1365
1365
reportWarningForUnknownValue(" Calling on unknown value. " + Trace .show, Trace .position)
1366
1366
case Bottom => Bottom
1367
- case ValueSet (values) if values.size == 1 =>
1368
- evalByNameParam( values.head)
1369
- case _ : ValueSet | _ : Ref | _ : ArrayRef | _ : Package | SafeValue (_) =>
1367
+ case ValueSet (values) =>
1368
+ values.map(evalByNameParam(_)).join
1369
+ case _ : Ref | _ : ArrayRef | _ : Package | SafeValue (_) =>
1370
1370
report.warning(" [Internal error] Unexpected by-name value " + value.show + " . " + Trace .show, Trace .position)
1371
1371
Bottom
1372
1372
end evalByNameParam
Original file line number Diff line number Diff line change
1
+ class X {
2
+ def bar (): Int = 5
3
+ }
4
+ class Y extends X {
5
+ override def bar (): Int = 6
6
+ }
7
+
8
+ object O {
9
+ def foo (p : => X ) = {
10
+ p.bar()
11
+ }
12
+
13
+ val a = foo(new X )
14
+ val b = foo(new Y )
15
+ }
You can’t perform that action at this time.
0 commit comments