Fix @[Primitive] codegen for typedefs#16110
Merged
straight-shoota merged 4 commits intocrystal-lang:masterfrom Aug 29, 2025
Merged
Fix @[Primitive] codegen for typedefs#16110straight-shoota merged 4 commits intocrystal-lang:masterfrom
@[Primitive] codegen for typedefs#16110straight-shoota merged 4 commits intocrystal-lang:masterfrom
Conversation
straight-shoota
approved these changes
Aug 24, 2025
Collaborator
|
CI is completely broken? |
Contributor
Author
|
Apparently returning a typedef of a |
straight-shoota
approved these changes
Aug 26, 2025
Comment on lines
+221
to
+232
| it "can invoke pointer primitives on typedef" do | ||
| codegen(<<-CRYSTAL) | ||
| lib Test | ||
| type K = Void* | ||
| fun foo : K | ||
| end | ||
|
|
||
| Test.foo + 1 | ||
| Test.foo - Test.foo | ||
| Test.foo.realloc(1) | ||
| CRYSTAL | ||
| end |
Member
There was a problem hiding this comment.
issue: On Crystal 1.0 this spec fails: https://github.com/crystal-lang/crystal/actions/runs/17244868139/job/48931777770?pr=16110
Module validation failed: Function return type does not match operand type of return inst!
ret void* %10
i8* (Exception)
Contributor
Author
There was a problem hiding this comment.
It's most certainly a pre-LLVM 15 issue with non-opaque pointers, we should have enabled LLVM CI for compiler source code dealing with codegen
straight-shoota
approved these changes
Aug 27, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16097.
These include typedef receivers in
Pointer#+,Pointer#-,Pointer#realloc,and all lib struct or union setters, as well as typedef arguments in allProc#call,@[Primitive(:binary)]methods (e.g.#&+and#==).This does not affect the interpreter (see #14151).