summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
2318f67)
Change-Id: I02da6fe19a96d110bfcd43516c893fea40082cf1
return Types.metaVar(Kinds.STAR);
}
if(alias != null) {
return Types.metaVar(Kinds.STAR);
}
if(alias != null) {
- if(parameters.length != alias.getArity()) {
+ int arity = alias.getArity();
+ if(parameters.length < arity) {
context.getErrorLog().log(location, "Wrong number of parameters are given to the type alias. Expected " +
context.getErrorLog().log(location, "Wrong number of parameters are given to the type alias. Expected " +
- alias.getArity() + " parameters, got " + parameters.length + " parameters.");
+ arity + " parameters, got " + parameters.length + " parameters.");
return Types.metaVar(Kinds.metaVar());
}
return Types.metaVar(Kinds.metaVar());
}
- Type[] parameterTypes = new Type[parameters.length];
- for(int i=0;i<parameters.length;++i)
+ Type[] parameterTypes = new Type[arity];
+ for(int i=0;i<arity;++i)
parameterTypes[i] = parameters[i].toType(context, Kinds.metaVar());
parameterTypes[i] = parameters[i].toType(context, Kinds.metaVar());
- return alias.body.replace(alias.parameters, parameterTypes);
+ Type result = alias.body.replace(alias.parameters, parameterTypes);
+ for(int i=arity;i<parameters.length;++i)
+ result = Types.apply(result, parameters[i].toType(context, Kinds.metaVar()));
+ return result;
create :: () -> <Proc> T a b
create = MMap.create
create :: () -> <Proc> T a b
create = MMap.create