-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: copy structures implementation [fixes LNG-102] #646
Conversation
# Conflicts: # model/inline/src/main/scala/aqua/model/inline/raw/ApplyPropertiesRawInliner.scala
@@ -17,7 +19,7 @@ object ParMode extends MergeMode | |||
* @param mergeMode how `flattenValues` and `predo` must be merged | |||
*/ | |||
private[inline] case class Inline( | |||
flattenValues: Map[String, ValueRaw] = Map.empty, | |||
flattenValues: ListMap[String, ValueRaw] = ListMap.empty, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ListMap
? Comment plz
value match { | ||
case v @ VarModel(name, _, _) => | ||
for { | ||
name <- Mangler[S].findAndForbidName(name + "_obj_copy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pattern matching seems unnecessary there
- Variable shadowing looks overcomplicated, not sure which
name
is used where
) | ||
case _ => | ||
State.pure(vm -> Inline.empty) | ||
private def flatVar[S: Mangler: Exports: Arrows]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Comment plz, what it does
flat
is not a verb, maybeflatten
? OrremoveProperties
? OrflattenProperties
?- It looks like not all the typeclasses are needed here, I see only
Mangler
used
) { case (state, property) => | ||
state.flatMap { case (vm, leftInline) => | ||
unfoldProperty(vm, property).flatMap { | ||
case (v, i) if !propertiesAllowed && v.properties.nonEmpty => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot say I fully get what happens there
fixes LNG-102