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

spreading in types not formatted correctly #154

Closed
bobzhang opened this issue Oct 12, 2020 · 3 comments
Closed

spreading in types not formatted correctly #154

bobzhang opened this issue Oct 12, 2020 · 3 comments
Labels
bug Something isn't working stale

Comments

@bobzhang
Copy link
Member

bobzhang commented Oct 12, 2020

type oo = < o ; lo : int >

formatted as blow

type oo = {, "lo": int}
@bobzhang bobzhang added the bug Something isn't working label Oct 12, 2020
@IwanKaramazow
Copy link
Contributor

The syntax for objects is not implemented. Only syntax sugar for Js.t.

type user = {"name": string, "age": int}

becomes

type nonrec user = <name: string; age: int> Js.t

How important is this feature?

@bobzhang
Copy link
Member Author

several suggestions:

  • if it fails, it should fail aloud
  • In the future, we want to do some work to make type Js.t <a> = a, in that case the spreading still makes sense. we should revisit this when we land that feature, some proposed syntax:
type user = { ... basic, "age" : int }

@stale
Copy link

stale bot commented May 29, 2023

The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.

@stale stale bot added the stale label May 29, 2023
@stale stale bot closed this as completed Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants