From 6596d8fd47d0fc15b7aa3c70b7619cd4b2625e6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Wed, 18 Oct 2017 14:28:14 +0300 Subject: [PATCH] (refs #7561) Allow extra parameters to the application of type alias Change-Id: I02da6fe19a96d110bfcd43516c893fea40082cf1 --- .../compiler/internal/parsing/types/TApplyAst.java | 14 +++++++++----- .../org.simantics.scl.osgi/scl/Extras/HashMap.scl | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) 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 -- 2.47.1