File tree Expand file tree Collapse file tree
JavaIntegration/src/main/java/org/openzen/zencode/java/module Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import org .openzen .zenscript .codemodel .identifiers .instances .IteratorInstance ;
1414import org .openzen .zenscript .codemodel .type .TypeID ;
1515import org .openzen .zenscript .codemodel .type .member .ExpandedResolvedType ;
16+ import org .openzen .zenscript .javashared .types .JavaFunctionalInterfaceTypeID ;
1617
1718import java .util .Collections ;
1819import java .util .List ;
@@ -114,6 +115,13 @@ public List<MethodSymbol> getInterfaceMethodsToImplement() {
114115
115116 @ Override
116117 public boolean extendsOrImplements (TypeID type , List <ExpansionSymbol > expansions ) {
118+ if (type instanceof JavaFunctionalInterfaceTypeID ) {
119+ JavaFunctionalInterfaceTypeID func = ((JavaFunctionalInterfaceTypeID ) type );
120+ Class <?> cls = this .template .class_ .cls ;
121+ if (func .functionalInterfaceMethod .getDeclaringClass ().isAssignableFrom (cls )) {
122+ return true ;
123+ }
124+ }
117125 return this .type .canCastToBecauseOfWildcardGenerics (type , expansions );
118126 }
119127
You can’t perform that action at this time.
0 commit comments