New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Record merging syntax with switch statement adds a semicolon instead of a comma #70
Comments
Strange! It looks like there is an extraneous quotation mark in The most likely underlying cause is that Prettier is falling back to the JavaScript formatter, which can happen if there is a plugin installation issue. |
(can probably be simplified) type AgeGroup = {
#minor;
#adult;
};
type Person = {
name : Text;
ageGroup : AgeGroup;
};
type Permissions = {
some : Text;
};
type PPerson = Person and Permissions;
let person_1 : Person = {
name = "John";
ageGroup = #minor;
};
func ageGroup(p : Person) : AgeGroup {
return p.ageGroup;
};
func pperson(p : Person) : PPerson {
{
p and (
switch (ageGroup(p)) {
case (#minor) { { some = "M" } };
case (#adult) { { some = "A" } };
}, // ADDED? OK
): // ADDED? NOK
};
};
Playground: link |
Okay, thanks! I see what you're saying and will look into fixing this. |
Fixed in |
Example case:
The text was updated successfully, but these errors were encountered: