Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Annotations on field names are eaten by formatting. #583

Closed
cristianoc opened this issue Jun 27, 2022 · 0 comments
Closed

Annotations on field names are eaten by formatting. #583

cristianoc opened this issue Jun 27, 2022 · 0 comments

Comments

@cristianoc
Copy link
Contributor

cristianoc commented Jun 27, 2022

 let make = ({name: @optional name}: props<_>) => name->Belt.Option.getWithDefault("")->React.string // 2

becomes

  let make = ({name}: props<_>) => name->Belt.Option.getWithDefault("")->React.string // 2

Also, the punned version gives a syntax error:

  let make = ({@optional name}: props<_>) => name->Belt.Option.getWithDefault("")->React.string // 2

This is also eaten by formatting:

let z = name => { name : @optional  name, x:3}

And this is a syntax error:

let z = name => { @optional name, x: 3}
@cristianoc cristianoc added this to the v10.1 milestone Jun 27, 2022
cristianoc added a commit that referenced this issue Jun 27, 2022
Add examples of expression and patterns showing where they are dropped.

See #583
cristianoc added a commit that referenced this issue Jun 27, 2022
cristianoc added a commit that referenced this issue Jun 27, 2022
Add examples of expression and patterns showing where they are dropped.

See #583
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant