Open eladb opened 1 month ago
I'm not sure what would be a good solution here. The problem stems from the fact that structs can contains classes (which goes againes their definition in the spec, btw, as "data bags"). This is a a whole other discussion we need to have (@Chriscbr...).
Since Output
contains a Bucket
class we don't know if it should contain the preflight or inflight version of Bucket
. Or maybe we need to create 2 Outputs
once for each phase and be smarter about how to lift structs?
structs can contain classes
Related discussion https://github.com/winglang/wing/discussions/5102
How about we suppose that in the TypeScript world we generate both Output and Output$Inflight, which will contain Bucket and Bucket$Inflight respectively.
In the example, the compiler could determine it needs to use Output$Inflight in the "foo" method since it's an inflight function.
@yoav-steinberg WDYT?
I tried this:
This happened:
The generated
.d.ts
file looks like this:I expected this:
I expected
Output
to includeBucket$Inflight
.Is there a workaround?
No response
Anything else?
No response
Wing Version
No response
Node.js Version
No response
Platform(s)
No response
Community Notes