From 5466c0883d5799f6af65d5fb22e6c4f92de51f02 Mon Sep 17 00:00:00 2001 From: thk123 Date: Tue, 13 Aug 2019 12:20:47 +0100 Subject: [PATCH] Improve error message when functional method is inherited This error can be erroneously triggered both when there are default methods on the interface (meaning >1 methods) or when the method is actually defined in an inherited interface (meaning 0 methods). Extend the warning message to explain both cases. --- jbmc/src/java_bytecode/lambda_synthesis.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jbmc/src/java_bytecode/lambda_synthesis.cpp b/jbmc/src/java_bytecode/lambda_synthesis.cpp index 76f0ca81102..56971cda810 100644 --- a/jbmc/src/java_bytecode/lambda_synthesis.cpp +++ b/jbmc/src/java_bytecode/lambda_synthesis.cpp @@ -121,7 +121,9 @@ static optionalt interface_method_id( << functional_interface_tag.get_identifier() << " which should have exactly one abstract method but actually has " << implemented_interface_type.methods().size() - << ". Note default methods are not supported yet." << messaget::eom; + << ". Note default methods are not supported yet." + << "Also note methods declared in an inherited interface are not " + << "supported either." << messaget::eom; return {}; } return implemented_interface_type.methods().at(0).get_name();