gleam icon indicating copy to clipboard operation
gleam copied to clipboard

Marking functions as deprecated

Open lpil opened this issue 4 years ago • 2 comments
trafficstars

When a deprecated function is used we want to detect this and emit a warning at compile time.

What should the syntax be? How should this be exposed to the user?

Possible attribute/tag syntax:

#deprecated()
pub fn one() { ... }

#deprecated(since: "1.1.0", note: "Will set fire to your laundry")
pub fn two() { ... }

lpil avatar Jan 08 '21 16:01 lpil

is the decorator syntax already standardized or would it be a first ?

tclain avatar Apr 08 '21 15:04 tclain

No syntax has been finalised and there is no decorators or similar yet. Bikeshedding and such is very welcome

lpil avatar Apr 08 '21 15:04 lpil

Updating the issue as the attribute syntax has been standardised.

What fields should the attribute have? Are they always required or are some optional?

lpil avatar Jun 29 '23 15:06 lpil