Beispiel #1
0
 @Override
 public boolean subtype(Type other, HashSet<SubtypeRelation> subtypes) {
   if (other instanceof JavaClassType) {
     if (Util.javaToWyvType(Integer.class).subtype(other, subtypes)) return true;
     return ((JavaClassType) other).getInnerClass().equals(Object.class);
   }
   return other instanceof Int;
 }
Beispiel #2
0
 private static List<NameBinding> getNameBindings(
     List<String> paramNames, Class[] parameterTypes) {
   ArrayList<NameBinding> output = new ArrayList<NameBinding>();
   int i = 0;
   for (Class arg : parameterTypes) {
     output.add(new NameBindingImpl(paramNames.get(i++), Util.javaToWyvType(arg)));
   }
   return output;
 }
Beispiel #3
0
 private static List<NameBinding> getNameBindings(Method m) {
   Class[] args = m.getParameterTypes();
   List<String> names = getNames(m);
   ArrayList<NameBinding> output = new ArrayList<NameBinding>();
   int i = 0;
   for (Class arg : args) {
     output.add(new NameBindingImpl(names.get(i++), Util.javaToWyvType(arg)));
   }
   return output;
 }