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(compiler): Generate stream restriction for scoped exprs [fixes LNG-222] #841

Merged
merged 6 commits into from
Aug 17, 2023

Conversation

InversionSpaces
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Aug 16, 2023

LNG-222 Scope (`new`) generation for streams doesn't work with `try`

try makes compiler skip new for declared stream

func main():
        temp: *i8
        temp <<- 42

produces

(seq
 (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
 (xor
  (new $temp
   (ap 42 $temp)
  )
  (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 0])
 )
)

while

func main():
    try:
        temp: *i8
        temp <<- 42

produces

(seq
 (call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
 (xor
  (xor
   (ap 42 $temp)
   (null)
  )
  (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 0])
 )
)

@InversionSpaces InversionSpaces added the e2e Run e2e workflow label Aug 16, 2023
@InversionSpaces InversionSpaces marked this pull request as ready for review August 16, 2023 14:27
@InversionSpaces InversionSpaces merged commit eb4cdb0 into main Aug 17, 2023
@InversionSpaces InversionSpaces deleted the fix/scope-streams branch August 17, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants