comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/TypeSystemTest.java @ 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)
author Christian Humer <christian.humer@gmail.com>
date Mon, 05 Jan 2015 20:23:22 +0100
parents 3912400fc33a
children 93016f2f3f16
comparison
equal deleted inserted replaced
18781:941761f6b736 18782:3ea386a1036f
39 static class SimpleTypes { 39 static class SimpleTypes {
40 40
41 static int intCheck; 41 static int intCheck;
42 static int intCast; 42 static int intCast;
43 43
44 @TypeCheck 44 @TypeCheck(int.class)
45 public static boolean isInteger(Object value) { 45 public static boolean isInteger(Object value) {
46 intCheck++; 46 intCheck++;
47 return value instanceof Integer; 47 return value instanceof Integer;
48 } 48 }
49 49
50 @TypeCast 50 @TypeCast(int.class)
51 public static int asInteger(Object value) { 51 public static int asInteger(Object value) {
52 intCast++; 52 intCast++;
53 return (int) value; 53 return (int) value;
54 } 54 }
55 55