-
Notifications
You must be signed in to change notification settings - Fork 463
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
Fix renamed field access in inline records #6551
Conversation
jscomp/test/as_inline_record_test.js
Outdated
@@ -6,10 +6,18 @@ function getName(t) { | |||
return t.renamed; | |||
} | |||
|
|||
function getName$p(t) { | |||
return t.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can see the error here, should be:
return t.name; | |
return t.renamed; |
Just adding the functions doesn't work, you need to actually call them https://github.com/melange-re/melange-compiler-libs/pull/26/files |
you're the best @anmonteiro, thanks a lot, it's working now! |
9419c6d
to
6a2c168
Compare
CONTRIBUTING.md
Outdated
|
||
Bug fixes and maintenance should target branch `11.0_release`. | ||
We'll merge `11.0_release` into `master` from time to time to propagate those changes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
328b3c9
to
afd2b59
Compare
@@ -59,6 +75,15 @@ let blk_record (fields : (label * _) array) mut record_repr = | |||
Lambda.Blk_record | |||
{ fields = all_labels_info; mutable_flag = mut; record_repr } | |||
|
|||
let blk_record_ext fields mutable_flag = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this function is assigned to a reference but never used elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is used in translcore in translcore on line 1240
@@ -46,8 +46,13 @@ let setup_env () = | |||
Record_attributes_check.check_duplicated_labels; | |||
Lambda.fld_record := Record_attributes_check.fld_record; | |||
Lambda.fld_record_set := Record_attributes_check.fld_record_set; | |||
Lambda.fld_record_inline := Record_attributes_check.fld_record_inline; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this indirection with references seems unnecessary.
It was probably used a long time ago to keep the standard version of the compiler, but currently there's only 1 version of the compiler used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I should just use direct bindings? OK I'll adapt the PR
21eebc3
to
6112b5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
If functions are uses in a single module only, I would even consider moving them to that module, instead of Lambda
.
Fixes #6549.
As suggested by @anmonteiro in his comment of issue #6438, I started with adding the remaining part from melange-re/melange#732
, but this is not enough.Edit: it works now :)