summaryrefslogtreecommitdiff
path: root/spec/05-classes-and-objects.md
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-06-23 12:53:23 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2015-06-23 13:15:49 +0200
commit3e7776e6418e047e11d0b11e5a85dfdc500b517e (patch)
tree199db99b6863d089327a4be823633718c4c908f3 /spec/05-classes-and-objects.md
parent5be0722abc913deea1a0bc3e433f1bf4c29f4e09 (diff)
downloadscala-3e7776e6418e047e11d0b11e5a85dfdc500b517e.tar.gz
scala-3e7776e6418e047e11d0b11e5a85dfdc500b517e.tar.bz2
scala-3e7776e6418e047e11d0b11e5a85dfdc500b517e.zip
Cast arguments where necessary before rewriting closure invocations
The parameter types of a closure invocation can be supertypes of the parameter types in the implementation method. The closure automatically casts arguments to the right type. We need to do the same when rewriting closure invocations. Example: val fun: String => String = l => l val l = List("") fun(l.head) The closure object calls `apply(Object)Object`. The body method takes an argument of type `String`.
Diffstat (limited to 'spec/05-classes-and-objects.md')
0 files changed, 0 insertions, 0 deletions