806 public PolyKind polyKind;
807
808 @Override public boolean isPoly() { return polyKind == PolyKind.POLY; }
809 @Override public boolean isStandalone() { return polyKind == PolyKind.STANDALONE; }
810 }
811
812 /**
813 * Common supertype for all functional expression trees (lambda and method references)
814 */
815 public abstract static class JCFunctionalExpression extends JCPolyExpression {
816
817 public JCFunctionalExpression() {
818 //a functional expression is always a 'true' poly
819 polyKind = PolyKind.POLY;
820 }
821
822 /** list of target types inferred for this functional expression. */
823 public Type target;
824 /** The owner of this functional expression. */
825 public Symbol owner;
826
827 public Type getDescriptorType(Types types) {
828 return target != null ? types.findDescriptorType(target) : types.createErrorType(null);
829 }
830 }
831
832 /**
833 * A class definition.
834 */
835 public static class JCClassDecl extends JCStatement implements ClassTree {
836 /** the modifiers */
837 public JCModifiers mods;
838 /** the name of the class */
839 public Name name;
840 /** formal class parameters */
841 public List<JCTypeParameter> typarams;
842 /** the classes this class extends */
843 public JCExpression extending;
844 /** the interfaces implemented by this class */
845 public List<JCExpression> implementing;
846 /** the subclasses allowed to extend this class, if sealed */
847 public List<JCExpression> permitting;
848 /** all variables and methods defined in this class */
849 public List<JCTree> defs;
|
806 public PolyKind polyKind;
807
808 @Override public boolean isPoly() { return polyKind == PolyKind.POLY; }
809 @Override public boolean isStandalone() { return polyKind == PolyKind.STANDALONE; }
810 }
811
812 /**
813 * Common supertype for all functional expression trees (lambda and method references)
814 */
815 public abstract static class JCFunctionalExpression extends JCPolyExpression {
816
817 public JCFunctionalExpression() {
818 //a functional expression is always a 'true' poly
819 polyKind = PolyKind.POLY;
820 }
821
822 /** list of target types inferred for this functional expression. */
823 public Type target;
824 /** The owner of this functional expression. */
825 public Symbol owner;
826 /** code reflection specific metadata. */
827 public CodeReflectionInfo codeReflectionInfo;
828
829 public Type getDescriptorType(Types types) {
830 return target != null ? types.findDescriptorType(target) : types.createErrorType(null);
831 }
832
833 public record CodeReflectionInfo(MethodSymbol codeModel, Type reflectableLambdaMetafactory) { }
834 }
835
836 /**
837 * A class definition.
838 */
839 public static class JCClassDecl extends JCStatement implements ClassTree {
840 /** the modifiers */
841 public JCModifiers mods;
842 /** the name of the class */
843 public Name name;
844 /** formal class parameters */
845 public List<JCTypeParameter> typarams;
846 /** the classes this class extends */
847 public JCExpression extending;
848 /** the interfaces implemented by this class */
849 public List<JCExpression> implementing;
850 /** the subclasses allowed to extend this class, if sealed */
851 public List<JCExpression> permitting;
852 /** all variables and methods defined in this class */
853 public List<JCTree> defs;
|