Skip to content
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

cgen: fix myarr [1]C.mytype fixed array fields, for pub type C.mytype = voidptr #21266

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

antono2
Copy link
Contributor

@antono2 antono2 commented Apr 12, 2024

"C__" was removed for fixed size C. arrays and resulted in unknown type.
Fixed by removing the removal.

Not sure which tests are expected to fail, so please double check.

Cheers,
Anton

@felipensp
Copy link
Member

What code have you used to test?

@antono2
Copy link
Contributor Author

antono2 commented Apr 12, 2024

What code have you used to test?

I needed this fix for my vulkan bindings, but it's not public yet.

git clone git@github.com:antono2/tmp.git
cd tmp
~/workspace/v_fork/v run examples/vk_glfw.v

@Delta456
Copy link
Member

What code have you used to test?

I needed this fix for my vulkan bindings, but it's not public yet.

git clone git@github.com:antono2/tmp.git
cd tmp
~/workspace/v_fork/v run examples/vk_glfw.v

Can you add a minimal reproduction at least?

@antono2
Copy link
Contributor Author

antono2 commented Apr 12, 2024

Can you add a minimal reproduction at least?

pub type C.mytype = voidptr

pub struct MyStruct {
pub mut:
  myarr [1]C.mytype
}

pub fn main(){
}

Yeah, could have done that in the first place.

@spytheman
Copy link
Member

spytheman commented Apr 18, 2024

Yeah, could have done that in the first place.

Please do. You can just make another commit on the same branch, and push it, then it will be included in this PR.

@spytheman spytheman changed the title Fixed size arrays of C.vars fixed cgen: fix myarr [1]C.mytype fixed array fields, for pub type C.mytype = voidptr Apr 23, 2024
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit 9ed3371 into vlang:master Apr 24, 2024
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants