Skip to content
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

fix: Canonicalize variable in object creation or copy if variable is a stream #649

Merged
merged 5 commits into from
Jan 27, 2023

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Jan 23, 2023

fixes LNG-112

@DieMyst DieMyst added the bug Something isn't working label Jan 23, 2023
@DieMyst DieMyst requested a review from folex January 23, 2023 08:26
@DieMyst DieMyst self-assigned this Jan 23, 2023
@linear
Copy link

linear bot commented Jan 23, 2023

@DieMyst DieMyst changed the title Canonicalize variable in object creation or copy if variable is a stream bug: Canonicalize variable in object creation or copy if variable is a stream Jan 23, 2023
@DieMyst DieMyst changed the title bug: Canonicalize variable in object creation or copy if variable is a stream fix: Canonicalize variable in object creation or copy if variable is a stream Jan 23, 2023
Comment on lines 37 to 43
CallServiceModel(
LiteralModel("\"json\"", ScalarType.string),
"obj",
CallModel(
args,
CallModel.Export(result.name, result.`type`) :: Nil
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move that pattern to a function so it's more readable? I see you do service calls like that in a few places.

Something like this might be nice (pseudocode)

def callService(service: String, function: String, args: HList) -> CallServiceModel = {
  CallServiceModel(LiteralModel(s"\"$service\"", ScalarType.string), function, args)
}

Comment on lines 128 to 129
ldfixed <- canonicalizeIfStream(ld._1, ld._2)
rdfixed <- canonicalizeIfStream(rd._1, rd._2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ldfixed <- canonicalizeIfStream(ld._1, ld._2)
rdfixed <- canonicalizeIfStream(rd._1, rd._2)
ldCanon <- canonicalizeIfStream(ld._1, ld._2)
rdCanon <- canonicalizeIfStream(rd._1, rd._2)

Comment on lines 37 to 44
val copyOp = CallServiceModel(
LiteralModel("\"json\"", ScalarType.string),
"puts",
CallModel(
value +: args,
CallModel.Export(result.name, result.`type`) :: Nil
)
).leaf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, def callService might make this more readable

@DieMyst DieMyst merged commit fedd743 into main Jan 27, 2023
@DieMyst DieMyst deleted the LNG-112-canon-on-obj-create-or-copy branch January 27, 2023 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants