-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2144 from certik/err
Give a C interoperability error for module structs also
- Loading branch information
Showing
5 changed files
with
18 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from lpython import packed, dataclass, i16, i64 | ||
|
||
@packed | ||
@dataclass | ||
class S: | ||
a: i16 | ||
b: i64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
semantic error: The struct in c_p_pointer must be C interoperable | ||
--> tests/errors/bindc_10e.py:23:38 | ||
--> tests/errors/bindc_10e.py:15:38 | ||
| | ||
23 | p2: Pointer[S] = c_p_pointer(p1, S) | ||
15 | p2: Pointer[S] = c_p_pointer(p1, S) | ||
| ^ not C interoperable | ||
|
||
--> tests/errors/bindc_10e_mod.py:5:1 - 7:10 | ||
| | ||
15 | class S: | ||
5 | class S: | ||
| ~~~~~~~~... | ||
... | ||
| | ||
17 | b: i64 | ||
7 | b: i64 | ||
| ...~~~~~~~~~~ help: add the @ccallable decorator to this struct to make it C interoperable |