From b86b48ed4c75bf046073b5edac8399f2019f5b94 Mon Sep 17 00:00:00 2001 From: Steffen Michels Date: Fri, 24 May 2019 16:07:03 +0200 Subject: [PATCH] fix children type checking for case in which children don't have a valid value, but consecutive children have --- Libraries/iTasks/Extensions/Editors/DynamicEditor.icl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl b/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl index 06261751a..c03d3b340 100644 --- a/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl +++ b/Libraries/iTasks/Extensions/Editors/DynamicEditor.icl @@ -298,7 +298,7 @@ where | e =: JSONNull || e =: (JSONArray []) // A null or an empty array are accepted as a reset events //If necessary remove the fields of the previously selected cons # change = ChangeUI [] $ removeNChildren $ length childSts - = (Ok (change, Nothing, [nullState: childSts]), vst) + = (Ok (change, Nothing, [nullState]), vst) | otherwise = (Error $ concat ["Unknown dynamic editor select event: '", toString e, "'"], vst) @@ -502,7 +502,9 @@ where where childTypesAreMatching` :: !Dynamic ![Maybe Dynamic] -> MaybeErrorString () childTypesAreMatching` _ [] = Ok () - childTypesAreMatching` cons [Nothing: otherArgs] = childTypesAreMatching` cons otherArgs + childTypesAreMatching` cons [Nothing: otherArgs] = + case cons of + (cons` :: a -> z) = childTypesAreMatching` (dynamic cons` undef) otherArgs childTypesAreMatching` cons [Just nextArg: otherArgs] = case (cons, nextArg) of // `cons` undef` has type z`, which is z updated by unifying the type of the next arg -- GitLab