Skip to content

Commit

Permalink
Added support to checker for append assignable (most added in earlier…
Browse files Browse the repository at this point in the history
… commit, this should properly compute the type)
  • Loading branch information
mahills committed Nov 24, 2013
1 parent cafcfad commit e501c8b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/org/rascalmpl/library/lang/rascal/types/CheckTypes.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -5310,16 +5310,7 @@ public CheckResult checkAssignment(Assignment assn:(Assignment)`+=`, Assignable

@doc{General function to calculate the type of an append.}
Symbol computeAppendType(Symbol t1, Symbol t2, loc l) {
if (isListType(t1) && isListType(t2))
return lub(t1,t2);
// TODO: Not sure if we can append non-list items...
//if (isListType(t1) && !isContainerType(t2))
// return \list(lub(getListElementType(t1),t2));
//if (isListType(t2) && !isContainerType(t1))
// return \list(lub(t1,getListElementType(t2)));
//if (isListType(t1))
// return \list(lub(getListElementType(t1),t2));

if (isListType(t1)) return \list(lub(getListElementType(t1),t2));
return makeFailType("Append not defined on <prettyPrintType(t1)> and <prettyPrintType(t2)>", l);
}

Expand Down

0 comments on commit e501c8b

Please sign in to comment.