winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.07k stars 198 forks source link

Structs should not allow function type members #1907

Open Chriscbr opened 1 year ago

Chriscbr commented 1 year ago

Community Note

Please vote by adding a 👍 reaction to the issue to help us prioritize. If you are interested to work on this issue, please leave a comment.

I tried this:

struct A {
  x: num;
  y: str;
  z: inflight (str): str;
}

I expected this:

A compiler error

Instead, this happened:

It compiles

Component:

Compiler

Wing Version:

0.8.0

Node.js Version:

18.12.1

Platform(s):

MacOS

Anything else?

Wing spec: https://docs.winglang.io/reference/spec#31-structs

github-actions[bot] commented 1 year ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

github-actions[bot] commented 1 year ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!

Chriscbr commented 8 months ago

Maybe this should probably only apply to serializable structs (json struct or some other convention)