winglang / wing

A programming language for the cloud โ˜๏ธ A unified programming model, combining infrastructure and runtime code into one language โšก
https://winglang.io
Other
4.98k stars 196 forks source link

simulator error when calling an inflight closure that returns a bucket #6500

Closed yoav-steinberg closed 4 months ago

yoav-steinberg commented 4 months ago

I tried this:

bring cloud;

let my = new cloud.Bucket();

let foo = inflight (): cloud.Bucket => {
  return my;
};

test "test" {
  foo();
}

This happened:

fail โ”Œ main.wsim ยป root/env0/test:test
     โ”” Error: Resource "root/env0/test:test/Handler" does not have permission to perform operation "then" on resource "root/env0/Bucket".

I expected this:

to work

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.73.47

Node.js Version

No response

Platform(s)

No response

Community Notes

yoav-steinberg commented 4 months ago

Works on tf-aws platform

Chriscbr commented 4 months ago

Fixed in #6504