@Override public PTypeList caseASeqSeqType(ASeqSeqType node) throws AnalysisException { return node.getSeqof().apply(THIS); }
@Override public ILexLocation defaultPType(PType node) throws AnalysisException { return node.getLocation(); }
@Override public String defaultPType(PType node, PrettyPrinterEnv question) throws AnalysisException { return node.toString(); }
private List<PType> calculateTypes(AFunctionType ftype, boolean curried) { List<PType> r = new LinkedList<PType>(); for (PType t : ftype.getParameters()) { r.add(t.clone()); } if (curried) { r.addAll(handleCurries(ftype.getResult())); } return r; }
if (t.getDefinitions() != null) defs.addAll(t.getDefinitions()); AOperationType op = t.apply(THIS); result.add(op.getResult()); type.getOpType().setDefinitions(defs); } else
/** * Sets the {@code _actualResult} child of this {@link SOperationDefinitionBase} node. * @param value the new {@code _actualResult} child of this {@link SOperationDefinitionBase} node */ public void setActualResult(PType value) { if( value != null && value.parent() == null) { value.parent(this); } this._actualResult = value; }
throw new TypeCheckException("Unknown type: " + to, to.getLocation(), to); throw new TypeCheckException("Unknown type: " + from, from.getLocation(), from); String fstr = from.toString(); String tstr = to.toString(); return to.equals(from) ? Result.Yes : Result.No;
PType type = question.assistantFactory.createPTypeAssistant().typeResolve(exp.getExportType().clone(), null, THIS, question); exp.setExportType(type); TypeCheckerErrors.report(3189, "Exported type does not match actual type", act.getLocation(), act); TypeCheckerErrors.detail2("Exported", type, "Actual", act);
throw new TypeCheckException("Unknown type: " + sub, sub.getLocation(), sub); throw new TypeCheckException("Unknown type: " + sup, sup.getLocation(), sup); if (sub.equals(sup))
@Override public boolean equals(Object other) { // No need to dereference as we can't reference a parameter value if (other instanceof ParameterValue) { ParameterValue ov = (ParameterValue) other; return ov.type.equals(type); } return false; }
if (t.getDefinitions() != null) defs.addAll(t.getDefinitions()); type.getFuncType().setDefinitions(defs); } else
public boolean narrowerThanBaseCase(PType type, AAccessSpecifierAccessSpecifier accessSpecifier) { if (type.getDefinitions() != null) { boolean result = false; for (PDefinition d : type.getDefinitions()) { result = result || af.createPAccessSpecifierAssistant().narrowerThan(d.getAccess(), accessSpecifier); } return result; } else { return false; } }
private Collection<? extends PType> handleCurries(PType result) { List<PType> r = new LinkedList<PType>(); if (result instanceof AFunctionType) { AFunctionType ft = (AFunctionType) result; for (PType p : ft.getParameters()) { r.add(p.clone()); } r.addAll(handleCurries(ft.getResult())); } return r; }
/** * Sets the {@code _expType} child of this {@link AInstanceVariableDefinition} node. * @param value the new {@code _expType} child of this {@link AInstanceVariableDefinition} node */ public void setExpType(PType value) { if( value != null && value.parent() == null) { value.parent(this); } this._expType = value; }
if (t.getDefinitions() != null) definitions.addAll(t.getDefinitions());
@Override public int hashCode() { return type.hashCode(); }
public SSeqType getSeq(PType type) { try { return type.apply(af.getSeqTypeFinder()); } catch (AnalysisException e) { return null; } }
public static List<PMultipleBind> bindListFromPattern(PPattern pattern, PType type) { List<PMultipleBind> bindList = new LinkedList<PMultipleBind>(); ATypeMultipleBind tmBind = new ATypeMultipleBind(); List<PPattern> plist = new LinkedList<PPattern>(); plist.add(pattern.clone()); tmBind.setPlist(plist); tmBind.setType(type.clone()); bindList.add(tmBind); return bindList; }