The following code should compile but
sun.tools.java.CompilerError: invalid typecode: 13
at sun.tools.java.Type.getTypeCodeOffset(Type.java:367)
at sun.tools.tree.AddExpression.codeOperation(AddExpression.java:102)
at sun.tools.tree.BinaryExpression.codeValue(BinaryExpression.java:177)
at sun.tools.tree.AddExpression.codeValue(AddExpression.java:142)
at sun.tools.tree.AssignExpression.code(AssignExpression.java:65)
at sun.tools.tree.ExpressionStatement.code(ExpressionStatement.java:77)
at sun.tools.tree.CompoundStatement.code(CompoundStatement.java:137)
at sun.tools.javac.SourceField.code(SourceField.java:510)
at sun.tools.javac.SourceField.code(SourceField.java:472)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:913)
at sun.tools.javac.SourceClass.compile(SourceClass.java:865)
at sun.tools.javac.Main.compile(Main.java:267)
at sun.tools.javac.Main.main(Main.java:375)
JCK-102a/tests/java_spec/src/EXPR/expr023/expr023.java:0: class javasoft.sqe.tests.java_spec.expr023.expr023:int run(java.lang.String[], java.io.PrintStream)@sun.tools.java.CompilerError: invalid typecode: 13
// Ident: @(#)expr023.java 1.1 96/02/19
// Copyright 19 Feb 1996 Sun Microsystems, Inc. All Rights Reserved
package javasoft.sqe.tests.java_spec.expr023;
import java.io.PrintStream;
import java.lang.String;
public class expr023 {
static int square(int i) {
return i * i;
}
public static void main(String args[]) {
System.exit(run(args,System.out));
}
public static int run(String args[],PrintStream out) {
boolean b = true;
int i = 3, a [] = new int [10];
String s = "abc";
i = (i = 1) * (square(i - 2) + --i);
out.print("* is tested; the result is ");
out.println(i); // should equals 1
i = ++i / ((i = 0) - square(i - 1));
out.print("/ is tested; the result is ");
out.println(i); // should equals -2
i = i-- % (square(i + 2) - (i += 1));
out.print("% is tested; the result is ");
out.println(i); // should equals -2
i = --i - square(i) * (i % 3);
out.print("- is tested; the result is ");
out.println(i); // should equals -3
i = ++i + square(i) * (i % 2);
out.print("+ is tested; the result is ");
out.println(i); // should equals -2
s = (s += "def") + (s += "gh");
out.print("String + is tested; the result is ");
out.println(s); // should equals "abcdefabcdefgh"
i = 1;
i = (i = 2) << i;
out.print("<< is tested; the result is ");
out.println(i); // should equals 8
i = i-- >> (i % 2);
out.print(">> is tested; the result is ");
out.println(i); // should equals 4
i = -1;
i = i++ >>> (i < 0 ? 30 : 31);
out.print(">>> is tested; the result is ");
out.println(i); // should equals 1
b = (i *= 2) < i + 1;
out.print("< is tested; the result is ");
out.println(b); // should equals true
b = (i /= 2) <= i - 1;
out.print("<= is tested; the result is ");
out.println(b); // should equals false
b = i-- > i;
out.print("> is tested; the result is ");
out.println(b); // should equals true
b = ++i >= i + 1;
out.print(">= is tested; the result is ");
out.println(b); // should equals false
b = i-- == i;
out.print("== is tested; the result is ");
out.println(b); // should equals false
b = ++i != i + 1;
out.print("!= is tested; the result is ");
out.println(b); // should equals true
i = 1;
i = (i <<= 1) & i--;
out.print("& is tested; the result is ");
out.println(i); // should equals 2
i = (i <<= 1) | --i;
out.print("| is tested; the result is ");
out.println(i); // should equals 7
i = (i <<= 1) ^ (i >>= 1);
out.print("^ is tested; the result is ");
out.println(i); // should equals 9
b = false;
b = (b = true) && b;
out.print("&& is tested; the result is ");
out.println(b); // should equals true
b = (b = false) || b;
out.print("|| is tested; the result is ");
out.println(b); // should equals false
i = 0;
a[i = 5] = square(i);
out.print("= is tested; the result is ");
out.println(a[5]); // should equals 25
return 1;
}
}
sun.tools.java.CompilerError: invalid typecode: 13
at sun.tools.java.Type.getTypeCodeOffset(Type.java:367)
at sun.tools.tree.AddExpression.codeOperation(AddExpression.java:102)
at sun.tools.tree.BinaryExpression.codeValue(BinaryExpression.java:177)
at sun.tools.tree.AddExpression.codeValue(AddExpression.java:142)
at sun.tools.tree.AssignExpression.code(AssignExpression.java:65)
at sun.tools.tree.ExpressionStatement.code(ExpressionStatement.java:77)
at sun.tools.tree.CompoundStatement.code(CompoundStatement.java:137)
at sun.tools.javac.SourceField.code(SourceField.java:510)
at sun.tools.javac.SourceField.code(SourceField.java:472)
at sun.tools.javac.SourceClass.compileClass(SourceClass.java:913)
at sun.tools.javac.SourceClass.compile(SourceClass.java:865)
at sun.tools.javac.Main.compile(Main.java:267)
at sun.tools.javac.Main.main(Main.java:375)
JCK-102a/tests/java_spec/src/EXPR/expr023/expr023.java:0: class javasoft.sqe.tests.java_spec.expr023.expr023:int run(java.lang.String[], java.io.PrintStream)@sun.tools.java.CompilerError: invalid typecode: 13
// Ident: @(#)expr023.java 1.1 96/02/19
// Copyright 19 Feb 1996 Sun Microsystems, Inc. All Rights Reserved
package javasoft.sqe.tests.java_spec.expr023;
import java.io.PrintStream;
import java.lang.String;
public class expr023 {
static int square(int i) {
return i * i;
}
public static void main(String args[]) {
System.exit(run(args,System.out));
}
public static int run(String args[],PrintStream out) {
boolean b = true;
int i = 3, a [] = new int [10];
String s = "abc";
i = (i = 1) * (square(i - 2) + --i);
out.print("* is tested; the result is ");
out.println(i); // should equals 1
i = ++i / ((i = 0) - square(i - 1));
out.print("/ is tested; the result is ");
out.println(i); // should equals -2
i = i-- % (square(i + 2) - (i += 1));
out.print("% is tested; the result is ");
out.println(i); // should equals -2
i = --i - square(i) * (i % 3);
out.print("- is tested; the result is ");
out.println(i); // should equals -3
i = ++i + square(i) * (i % 2);
out.print("+ is tested; the result is ");
out.println(i); // should equals -2
s = (s += "def") + (s += "gh");
out.print("String + is tested; the result is ");
out.println(s); // should equals "abcdefabcdefgh"
i = 1;
i = (i = 2) << i;
out.print("<< is tested; the result is ");
out.println(i); // should equals 8
i = i-- >> (i % 2);
out.print(">> is tested; the result is ");
out.println(i); // should equals 4
i = -1;
i = i++ >>> (i < 0 ? 30 : 31);
out.print(">>> is tested; the result is ");
out.println(i); // should equals 1
b = (i *= 2) < i + 1;
out.print("< is tested; the result is ");
out.println(b); // should equals true
b = (i /= 2) <= i - 1;
out.print("<= is tested; the result is ");
out.println(b); // should equals false
b = i-- > i;
out.print("> is tested; the result is ");
out.println(b); // should equals true
b = ++i >= i + 1;
out.print(">= is tested; the result is ");
out.println(b); // should equals false
b = i-- == i;
out.print("== is tested; the result is ");
out.println(b); // should equals false
b = ++i != i + 1;
out.print("!= is tested; the result is ");
out.println(b); // should equals true
i = 1;
i = (i <<= 1) & i--;
out.print("& is tested; the result is ");
out.println(i); // should equals 2
i = (i <<= 1) | --i;
out.print("| is tested; the result is ");
out.println(i); // should equals 7
i = (i <<= 1) ^ (i >>= 1);
out.print("^ is tested; the result is ");
out.println(i); // should equals 9
b = false;
b = (b = true) && b;
out.print("&& is tested; the result is ");
out.println(b); // should equals true
b = (b = false) || b;
out.print("|| is tested; the result is ");
out.println(b); // should equals false
i = 0;
a[i = 5] = square(i);
out.print("= is tested; the result is ");
out.println(a[5]); // should equals 25
return 1;
}
}
- duplicates
-
JDK-4009600 JCK-102a tests -- Compiler error: invalid typecode
- Closed
-
JDK-4008004 JCK expr023 causes CompilerError invalid typecode: 13
- Closed