fluencelabs / aqua

Programming language for distributed systems & p2p
https://fluence.dev/docs/aqua-book/introduction
GNU Affero General Public License v3.0
156 stars 24 forks source link

fix(compiler): Push to stream in closures [LNG-365] #1157

Closed DieMyst closed 5 months ago

DieMyst commented 5 months ago

Description

This didn't work:

func addToStreamClosure(str: *string) -> string -> ():
  cl = func (s: string):
    str <<- s
  <- cl

func addToStream() -> []string:
  stream: *string
  cl = addToStreamClosure(stream)
  cl("one")
  <- stream

because str hasn't been renamed in inliner.

Proposed Changes

rename exports of closure body on renameExports

Checklist

Reviewer Checklist

linear[bot] commented 5 months ago

LNG-365 Streams and maps not work with abilities

InversionSpaces commented 5 months ago

LGTM