From: Hannu Niemistö Date: Wed, 18 Oct 2017 11:28:14 +0000 (+0300) Subject: (refs #7561) Allow extra parameters to the application of type alias X-Git-Tag: v1.31.0~111 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=6596d8fd47d0fc15b7aa3c70b7619cd4b2625e6d;p=simantics%2Fplatform.git (refs #7561) Allow extra parameters to the application of type alias Change-Id: I02da6fe19a96d110bfcd43516c893fea40082cf1 --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/types/TApplyAst.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/types/TApplyAst.java index 3c7700075..1aeba2071 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/types/TApplyAst.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/types/TApplyAst.java @@ -49,15 +49,19 @@ public class TApplyAst extends TypeAst { 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 " + - alias.getArity() + " parameters, got " + parameters.length + " parameters."); + arity + " parameters, got " + parameters.length + " parameters."); return Types.metaVar(Kinds.metaVar()); } - Type[] parameterTypes = new Type[parameters.length]; - for(int i=0;i T a b create = MMap.create