Examples of constValue()


Examples of com.sun.tools.javac.code.Type.constValue()

                        log.error(c.pos(), "duplicate.case.label");
                    }
                } else {
                    Type pattype = attribExpr(c.pat, switchEnv, seltype);
                    if (pattype.tag != ERROR) {
                        if (pattype.constValue() == null) {
                            log.error(c.pat.pos(), "const.expr.req");
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
                            labels.add(pattype.constValue());
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                } else {
                    Type pattype = attribExpr(c.pat, switchEnv, seltype);
                    if (pattype.tag != ERROR) {
                        if (pattype.constValue() == null) {
                            log.error(c.pat.pos(), "const.expr.req");
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
                            labels.add(pattype.constValue());
                        }
                    }
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                        if (pattype.constValue() == null) {
                            log.error(c.pat.pos(), "const.expr.req");
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
                            labels.add(pattype.constValue());
                        }
                    }
                }
            } else if (hasDefault) {
                log.error(c.pos(), "duplicate.default.label");
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                        // the variable as undefined.
                        int pos = VarSymbol.this.pos;
                        VarSymbol.this.pos = Position.MAXPOS;
                        Type itype = attr.attribExpr(initializer, env, type);
                        VarSymbol.this.pos = pos;
                        if (itype.constValue() != null)
                            return attr.coerce(itype, type).constValue();
                        else
                            return null;
                    } finally {
                        log.useSource(source);
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

  try {
      if (opcode > ByteCodes.preMask) {
    // we are seeing a composite instruction of the form xcmp; ifxx.
    // In this case fold both instructions separately.
    Type t1 = fold2(opcode >> ByteCodes.preShift, left, right);
    return (t1.constValue() == null) ? t1
        : fold1(opcode & ByteCodes.preMask, t1);
      } else {
    Object l = left.constValue();
    Object r = right.constValue();
    switch (opcode) {
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

        try {
            if (opcode > ByteCodes.preMask) {
                // we are seeing a composite instruction of the form xcmp; ifxx.
                // In this case fold both instructions separately.
                Type t1 = fold2(opcode >> ByteCodes.preShift, left, right);
                return (t1.constValue() == null) ? t1
                    : fold1(opcode & ByteCodes.preMask, t1);
            } else {
                Object l = left.constValue();
                Object r = right.constValue();
                switch (opcode) {
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

        Lint prevLint = chk.setLint(env.info.lint);
        JavaFileObject prevSource = log.useSource(env.toplevel.sourcefile);

        try {
            Type itype = attribExpr(initializer, env, type);
            if (itype.constValue() != null)
                return coerce(itype, type).constValue();
            else
                return null;
        } finally {
            env.info.lint = prevLint;
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                        log.error(c.pos(), "duplicate.case.label");
                    }
                } else {
                    Type pattype = attribExpr(c.pat, switchEnv, seltype);
                    if (pattype.tag != ERROR) {
                        if (pattype.constValue() == null) {
                            log.error(c.pat.pos(),
                                      (stringSwitch ? "string.const.req" : "const.expr.req"));
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                    Type pattype = attribExpr(c.pat, switchEnv, seltype);
                    if (pattype.tag != ERROR) {
                        if (pattype.constValue() == null) {
                            log.error(c.pat.pos(),
                                      (stringSwitch ? "string.const.req" : "const.expr.req"));
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
                            labels.add(pattype.constValue());
                        }
                    }
View Full Code Here

Examples of com.sun.tools.javac.code.Type.constValue()

                            log.error(c.pat.pos(),
                                      (stringSwitch ? "string.const.req" : "const.expr.req"));
                        } else if (labels.contains(pattype.constValue())) {
                            log.error(c.pos(), "duplicate.case.label");
                        } else {
                            labels.add(pattype.constValue());
                        }
                    }
                }
            } else if (hasDefault) {
                log.error(c.pos(), "duplicate.default.label");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.