annotate truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemErrorsTest.java @ 22157:dc83cc1f94f2

Using fully qualified imports
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 16 Sep 2015 11:33:22 +0200
parents 9c8c0937da41
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11467
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
1 /*
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
4 *
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
8 *
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
13 * accompanied this code).
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
14 *
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
18 *
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
21 * questions.
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
22 */
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
23 package com.oracle.truffle.api.dsl.test;
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
24
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
25 import com.oracle.truffle.api.dsl.NodeChild;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
26 import com.oracle.truffle.api.dsl.TypeCast;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
27 import com.oracle.truffle.api.dsl.TypeCheck;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
28 import com.oracle.truffle.api.dsl.TypeSystem;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
29 import com.oracle.truffle.api.dsl.TypeSystemReference;
18783
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
30 import com.oracle.truffle.api.dsl.test.TypeSystemErrorsTest.Types1.Type1;
14991
64dcb92ee75a Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11479
diff changeset
31 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode;
11467
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
32
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
33 public class TypeSystemErrorsTest {
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
34
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
35 @TypeSystem({int.class, boolean.class})
18783
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
36 public static class ErrorTypes0 {
11467
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
37
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
38 }
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
39
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
40 @ExpectError("Invalid type order. The type(s) [java.lang.String] are inherited from a earlier defined type java.lang.CharSequence.")
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
41 @TypeSystem({CharSequence.class, String.class})
18783
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
42 public static class ErrorTypes1 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
43
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
44 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
45
11469
88316d1c4644 Truffle-DSL: preparations for implicit casts
Christian Humer <christian.humer@gmail.com>
parents: 11467
diff changeset
46 public static class Types1 {
18783
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
47 public static class Type1 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
48 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
49 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
50
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
51 public static class Types2 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
52 public static class Type1 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
53 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
54 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
55
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
56 // verify boxed type overlay
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
57 @ExpectError("Two types result in the same boxed name: Type1.")
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
58 @TypeSystem({Type1.class, com.oracle.truffle.api.dsl.test.TypeSystemErrorsTest.Types2.Type1.class})
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
59 public static class ErrorTypes2 {
11467
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
60
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
61 }
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
62
18783
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
63 public static class Types3 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
64 public static class Object {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
65 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
66 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
67
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
68 // verify Object name cannot appear
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
69 @ExpectError("Two types result in the same boxed name: Object.")
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
70 @TypeSystem({com.oracle.truffle.api.dsl.test.TypeSystemErrorsTest.Types3.Object.class})
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
71 public static class ErrorTypes3 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
72 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
73
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
74 public static class Types4 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
75 public static class Integer {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
76 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
77 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
78
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
79 // verify int boxed name
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
80 @ExpectError("Two types result in the same boxed name: Integer.")
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
81 @TypeSystem({int.class, com.oracle.truffle.api.dsl.test.TypeSystemErrorsTest.Types4.Integer.class})
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
82 public static class ErrorTypes4 {
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
83 }
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
84
7d67a33e1bbb Truffle-DSL: made type name verification more robust. Added some tests. (GRAAL-468 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 18782
diff changeset
85 @TypeSystemReference(ErrorTypes0.class)
11479
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
86 @NodeChild
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
87 @ExpectError("The @TypeSystem of the node and the @TypeSystem of the @NodeChild does not match. Types0 != SimpleTypes. ")
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
88 abstract static class ErrorNode1 extends ValueNode {
18782
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
89 }
11479
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
90
18782
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
91 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
92 public static class CastError1 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
93 @TypeCast(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
94 @ExpectError("The provided return type \"String\" does not match expected return type \"int\".%")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
95 public static String asInteger(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
96 return (String) value;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
97 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
98 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
99
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
100 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
101 public static class CastError2 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
102 @TypeCast(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
103 @ExpectError("The provided return type \"boolean\" does not match expected return type \"int\".%")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
104 public static boolean asInteger(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
105 return (boolean) value;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
106 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
107 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
108
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
109 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
110 public static class CastError4 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
111 @ExpectError("@TypeCast annotated method asInt must be public and static.")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
112 @TypeCast(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
113 public int asInt(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
114 return (int) value;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
115 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
116 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
117
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
118 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
119 public static class CastError5 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
120 @ExpectError("@TypeCast annotated method asInt must be public and static.")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
121 @TypeCast(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
122 static int asInt(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
123 return (int) value;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
124 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
125 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
126
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
127 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
128 public static class CheckError2 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
129 @ExpectError("@TypeCheck annotated method isInt must be public and static.")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
130 @TypeCheck(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
131 public boolean isInt(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
132 return value instanceof Integer;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
133 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
134 }
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
135
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
136 @TypeSystem({int.class})
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
137 public static class CheckError3 {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
138 @ExpectError("@TypeCheck annotated method isInt must be public and static.")
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
139 @TypeCheck(int.class)
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
140 static boolean isInt(Object value) {
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
141 return value instanceof Integer;
3ea386a1036f Truffle-DSL: breaking: @TypeCheck and @TypeCast now require casted/checked type as explicit parameter. Previously the type was parsed from the method name. (GRAAL-446 #resolve)
Christian Humer <christian.humer@gmail.com>
parents: 14991
diff changeset
142 }
11479
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
143 }
fce94b1d46f0 Truffle-DSL: fixed the @TypeSystem of child nodes were not checked for equality.
Christian Humer <christian.humer@gmail.com>
parents: 11469
diff changeset
144
11467
43eab069ca9b Truffle-DSL: improved error recovery of type systems and improved error testability infrastructure.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
145 }