From bcd0eeb349af607eb15428c04853a0be0948f80c Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Mon, 6 Sep 2021 17:46:04 +0100 Subject: [PATCH] Fix #45. Add coercion of LambdaExpression to functional interface No changes required to the implementation API. Changes will be required to the TCK. --- spec/src/main/asciidoc/ELSpec.adoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/src/main/asciidoc/ELSpec.adoc b/spec/src/main/asciidoc/ELSpec.adoc index 0b31b143..b2e9c53e 100644 --- a/spec/src/main/asciidoc/ELSpec.adoc +++ b/spec/src/main/asciidoc/ELSpec.adoc @@ -1492,6 +1492,19 @@ primitive type `boolean`, return `null` * If `A` is a `String` call `Enum.valueOf(T.getClass(), A)` and return the result +==== Coerce `A` to functional interface method invocation + + * If `A` is a `LambdaExpression` then: + + ** Return the result of invoking the `LambdaExpression` with the parameters + (coerced if necessary) that were passed to the Functional Interface method + invocation + + * Otherwise, apply the rules in <> + +Note: A Type is only considered to be a functional interface it it is annotated +with `java.lang.FunctionalInterface`. + ==== Coerce `A` to Any Other Type `T` * If `A` is `null`, return `null`