Skip to content
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

Consider relaxing ASTTransformer treatment of ranges in record fields #3026

Closed
Smaug123 opened this issue Dec 24, 2023 · 1 comment
Closed

Comments

@Smaug123
Copy link
Contributor

As used in Myriad, SynExprRecordField requires a range in the second argument (the "where is the equals sign" range, mEq) or else the conversion to an Oak will result in having no fields in the record due to

| SynExprRecordField((fieldName, _), Some mEq, Some expr, _) ->
. (So currently you end up with { } instead of a record with any fields, if you didn't supply the equals range.)

Would it be reasonable to treat None the same as Some range0 here? (That's what I've done in my client code and it seems to be fine.)

@nojaf
Copy link
Contributor

nojaf commented Dec 24, 2023

Hi there, similar requests have come up with this in the past.
Fantomas expects a valid syntax tree, as the parser would produce.
We don't want to take any requests to process imperfect syntax trees.
This is somewhat mentioned in the docs.

@nojaf nojaf closed this as not planned Won't fix, can't repro, duplicate, stale Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants