diff --git a/transpiler/src/main/java/org/jsweet/transpiler/JSweetContext.java b/transpiler/src/main/java/org/jsweet/transpiler/JSweetContext.java index b79c105b..214cc0c0 100644 --- a/transpiler/src/main/java/org/jsweet/transpiler/JSweetContext.java +++ b/transpiler/src/main/java/org/jsweet/transpiler/JSweetContext.java @@ -1260,12 +1260,22 @@ public class JSweetContext extends Context { } /** - * Tells if the given type is a Java interface. + * Tells if the given type is an interface. */ public boolean isInterface(TypeSymbol typeSymbol) { return (typeSymbol.type.isInterface() || hasAnnotationType(typeSymbol, JSweetConfig.ANNOTATION_INTERFACE)); } + /** + * Tells if the given type is an interface. + */ + public boolean isInterface(Element element) { + if (element instanceof TypeSymbol) { + return isInterface((TypeSymbol)element); + } + return false; + } + /** * Tells if the given symbol is annotated with one of the given annotation * types.