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.76k stars 187 forks source link

fix(compiler): adding statements before super() #6699

Closed marciocadev closed 5 days ago

marciocadev commented 2 weeks ago

This PR allows statements to be executed before calling super(), with the exception of any statement that includes the reserved word this or super and the super() call is only valid when called in the top scope of the constructor.

The PR also cleans up some redundant super() related diagnostics generated in parser.rs they were also handled (and more correctly) in _typecheck.rs.

Closes #6387

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

github-actions[bot] commented 2 weeks ago

Thanks for opening this pull request! :tada: Please consult the contributing guidelines for details on how to contribute to this project. If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and utility APIs @chriscbr
Wing Console @ainvoner, @skyrpex, @polamoros
JSON, structs, primitives and collections @hasanaburayyan
Platforms and plugins @hasanaburayyan
Frontend resources (website, react, etc) @tsuf239
Language design @chriscbr
VSCode extension and language server @markmcculloh
Compiler architecture, inflights, lifting @yoav-steinberg
Wing Testing Framework @tsuf239
Wing CLI @markmcculloh
Build system, dev environment, releases @markmcculloh
Library Ecosystem @chriscbr
Documentation @hasanaburayyan
SDK test suite @tsuf239
Examples @hasanaburayyan
Wing Playground @eladcon
marciocadev commented 6 days ago

I changed a lot to use the Visitor pattern, and I think it's better now.

mergify[bot] commented 5 days ago

Thanks for contributing, @marciocadev! This PR will now be added to the merge queue, or immediately merged if super-constructor is up-to-date with main and the queue is empty.

monadabot commented 4 days ago

Congrats! :rocket: This was released in Wing 0.75.13.