fix: Fix type for functor [fixes LNG-119] (#677)

This commit is contained in:
Dima 2023-02-28 14:56:49 +07:00 committed by GitHub
parent 9074381b89
commit bb24a63abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -41,6 +41,12 @@ object ApplyFunctorRawInliner extends Logging {
VarModel(apName, canonType, Chain.one(functorModel)), VarModel(apName, canonType, Chain.one(functorModel)),
CanonicalizeModel(v, CallModel.Export(apName, canonType)).leaf 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 _ => case _ =>
(VarModel(apName, bt, Chain.one(functorModel)), FlattenModel(v, apName).leaf) (VarModel(apName, bt, Chain.one(functorModel)), FlattenModel(v, apName).leaf)
} }

View File

@ -80,7 +80,7 @@ object MakeRes {
orInit(currentPeerId), orInit(currentPeerId),
exportTo exportTo
).leaf ).leaf
case FlattenModel(operand@VarModel(_, CanonStreamType(el), _), assignTo) => case FlattenModel(operand @ VarModel(_, CanonStreamType(el), _), assignTo) =>
ApRes(operand, CallModel.Export(assignTo, ArrayType(el))).leaf ApRes(operand, CallModel.Export(assignTo, ArrayType(el))).leaf
case FlattenModel(operand, assignTo) => case FlattenModel(operand, assignTo) =>
ApRes(operand, CallModel.Export(assignTo, operand.`type`)).leaf ApRes(operand, CallModel.Export(assignTo, operand.`type`)).leaf