Skip to content

Commit b978ad9

Browse files
committed
Fix test for poly functions
1 parent a7af9d8 commit b978ad9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ class Semantic {
257257
Result(Hot, error :: Nil)
258258

259259
case Fun(body, thisV, klass) =>
260-
if meth.name == nme.apply then eval(body, thisV, klass, cacheResult = true)
261-
else if meth.name.toString == "tupled" then Result(value, Nil)
262-
else Result(Hot, Nil) // TODO: refine
260+
// meth == NoSymbol for poly functions
261+
if meth.name.toString == "tupled" then Result(value, Nil)
262+
else eval(body, thisV, klass, cacheResult = true)
263263

264264
case RefSet(refs) =>
265265
val resList = refs.map(_.call(meth, superType, source))

tests/init/neg/polyfun.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ class Test {
44
println(n)
55
arg
66
}
7-
val n = m.apply(arg = 23)
7+
val n = m.apply(arg = 23) // error
88
}

0 commit comments

Comments
 (0)