Skip to content

mel.as doesn't work on inline records #730

@jchavarri

Description

@jchavarri

Input

type user = { name : string [@mel.as "MyName"] }

let user = { name = "Corentin" }

type user2 = User of { name : string [@mel.as "MyName"] }

let user2 = User { name = "Corentin" }

Output

// Generated by Melange


var user = {
  MyName: "Corentin"
};

var user2 = /* User */{
  name: "Corentin"
};

export {
  user ,
  user2 ,
}
/* No side effect */

Expected:

var user2 = /* User */{
  MyName: "Corentin"
};

https://melange.re/unstable/playground/?language=OCaml&code=dHlwZSB1c2VyID0geyBuYW1lIDogc3RyaW5nIFtAbWVsLmFzICJNeU5hbWUiXSB9CgpsZXQgdXNlciA9IHsgbmFtZSA9ICJDb3JlbnRpbiIgfQoKdHlwZSB1c2VyMiA9IFVzZXIgb2YgeyBuYW1lIDogc3RyaW5nIFtAbWVsLmFzICJNeU5hbWUiXSB9CgpsZXQgdXNlcjIgPSBVc2VyIHsgbmFtZSA9ICJDb3JlbnRpbiIgfQo%3D&live=off

cc @tatchi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions