public boolean can_be_assigned_from(PhantomType src) { if (this.equals(src)) return true; if (!_is_known) return true; // variables of unknown type can eat anything if (!src._is_known) return false; // i know my type and he doesnt if (_is_void || src._is_void) return false; if (_is_container != src._is_container) return false; if (is_on_int_stack() && src.is_on_int_stack()) return true; if (get_class() == null) return true; return get_class().can_be_assigned_from(src.get_class()); }
public String toString() { StringBuffer sb = new StringBuffer(); sb.append(type.toString()); sb.append(" "); sb.append(name); sb.append("( "); boolean first = true; for (Iterator<ArgDefinition> i = args_def.iterator(); i.hasNext(); ) { if (!first) sb.append(", "); first = false; sb.append(i.next().toString()); } sb.append(" )"); return sb.toString(); }