Commit Graph

3 Commits

Author SHA1 Message Date
Mikhail Glukhikh 8bab208322 FIR2IR: use information about callable reference adaptation from resolve 2021-02-15 17:08:08 +03:00
Alexander Udalov 0681231e99 Introduce AdaptedFunctionReference runtime class
It's used as a superclass for anonymous classes for adapted function
references. Its main feature is that it _doesn't_ inherit from KFunction
(as opposed to FunctionReference), as per the decision to postpone
reflection support for adapted function references in KT-36024.

 #KT-36024 Fixed
2020-04-08 19:15:38 +02:00
Alexander Udalov 3269a7e693 Change behavior of equals/hashCode on adapted function references
Function references are now equal if they refer to the same function,
and if the parameter/return type adaptation, which happens when a
reference is used where some function type is expected, is exactly the
same. This includes the number of expected positional parameters (which
can be affected by defaults/varargs), whether the coercion of vararg
parameter to Array type happened, and whether the coercion of return
type to Unit happened.

 #KT-37543 Fixed
2020-04-01 14:18:49 +02:00