You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the above example should NOT work. We can't take a pointer to a non bind(c) quantity. The c_loc and c_funcloc should only work on bind(c), nothing else.
Activity
certik commentedon Jul 8, 2023
Everything passes except:
certik commentedon Jul 9, 2023
Here is a minimal reproducible example that fails in master, but succeeds with #2124 (but this PR break another important test):
In master:
In #2124:
$ PYTHONPATH=src/runtime/lpython/ python a.py $certik commentedon Jul 9, 2023
The
allocis just a Python implementation of a C-style alloc, it returns a pointer to a preallocated memory.We need to be able to cast it to a struct correctly. We are with #2124, but then a dataclass test stops working.
certik commentedon Jul 9, 2023
I think the above example should NOT work. We can't take a pointer to a non bind(c) quantity. The c_loc and c_funcloc should only work on bind(c), nothing else.
certik commentedon Jul 9, 2023
It must be done like this:
and then it works.
certik commentedon Jul 9, 2023
I added tests that have to work correctly in #2126, and they seem to work fine. So that's good news.
Now the next step is to give an error message for usage that should not work.
rebcabin commentedon Jul 9, 2023
approved
certik commentedon Jul 9, 2023
The error message is done here: #2133. It found many incorrect tests that I fixed.
However, in the process I discovered further bugs with structs, such as #2134.