swiftlang / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.
Apache License 2.0
3.24k stars 413 forks source link

remove lazy modifier from computed property produced by accessor macro #2800

Closed Gotyanov closed 2 months ago

Gotyanov commented 2 months ago

https://forums.swift.org/t/accessor-macros-and-lazy-properties/73869

ahoppen commented 2 months ago

Thanks for the PR @Gotyanov.

Accessor macros on lazy properties should be invalid because they can remove the laziness of the property, which has can cause surprising behavior. We could probably improve the error message in the compiler.