From bb24a63abb2849ea1df756f6a2a2fc5f6b408309 Mon Sep 17 00:00:00 2001 From: Dima Date: Tue, 28 Feb 2023 14:56:49 +0700 Subject: [PATCH] fix: Fix type for functor [fixes LNG-119] (#677) --- .../aqua/model/inline/raw/ApplyFunctorRawInliner.scala | 6 ++++++ model/res/src/main/scala/aqua/res/MakeRes.scala | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/model/inline/src/main/scala/aqua/model/inline/raw/ApplyFunctorRawInliner.scala b/model/inline/src/main/scala/aqua/model/inline/raw/ApplyFunctorRawInliner.scala index a2279c29..57b0cb0a 100644 --- a/model/inline/src/main/scala/aqua/model/inline/raw/ApplyFunctorRawInliner.scala +++ b/model/inline/src/main/scala/aqua/model/inline/raw/ApplyFunctorRawInliner.scala @@ -41,6 +41,12 @@ object ApplyFunctorRawInliner extends Logging { VarModel(apName, canonType, Chain.one(functorModel)), CanonicalizeModel(v, CallModel.Export(apName, canonType)).leaf ) + case CanonStreamType(el) => + val arrType = ArrayType(el) + ( + VarModel(apName, arrType, Chain.one(functorModel)), + FlattenModel(v, apName).leaf + ) case _ => (VarModel(apName, bt, Chain.one(functorModel)), FlattenModel(v, apName).leaf) } diff --git a/model/res/src/main/scala/aqua/res/MakeRes.scala b/model/res/src/main/scala/aqua/res/MakeRes.scala index 216b30d0..494b0008 100644 --- a/model/res/src/main/scala/aqua/res/MakeRes.scala +++ b/model/res/src/main/scala/aqua/res/MakeRes.scala @@ -80,7 +80,7 @@ object MakeRes { orInit(currentPeerId), exportTo ).leaf - case FlattenModel(operand@VarModel(_, CanonStreamType(el), _), assignTo) => + case FlattenModel(operand @ VarModel(_, CanonStreamType(el), _), assignTo) => ApRes(operand, CallModel.Export(assignTo, ArrayType(el))).leaf case FlattenModel(operand, assignTo) => ApRes(operand, CallModel.Export(assignTo, operand.`type`)).leaf