-
Notifications
You must be signed in to change notification settings - Fork 22
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 more JET issues #951
Fix more JET issues #951
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,7 +219,8 @@ function julia_to_gap( | |
elseif Wrappers.IsRecord(obj) | ||
ret_val = NewPrecord(0) | ||
recursion_dict[obj] = ret_val | ||
for x in Vector{String}(Wrappers.RecNames(obj)) | ||
for xx in Wrappers.RecNames(obj)::GapObj | ||
x = Wrappers.RNamObj(xx) | ||
Wrappers.ASS_REC(ret_val, x, julia_to_gap(Wrappers.ELM_REC(obj, x), recursion_dict; recursive = true)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (and this code is still wrong, I'll look into fixing it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I just updated the PR accordingly and added a test. |
||
end | ||
else | ||
|
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.
I read this as the recommendation to use always
===
or!==
when comparing something withtrue
,false
,GAP.Globals.fail
.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.
Yeah. It at least ensures that the compiler can always turn this into the most optimal code; here, it can't predict the type of
x[1]
so it should check at runtime whether there is a==
method for whateverx[1]
is plus aBool
... But we have extra information about the intent of the code, so that===
is what we want, and can totally away runtime dispatch here.