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

Support pointer-pointers in the type system #756

Open
yorickpeterse opened this issue Sep 4, 2024 · 0 comments
Open

Support pointer-pointers in the type system #756

yorickpeterse opened this issue Sep 4, 2024 · 0 comments
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module

Comments

@yorickpeterse
Copy link
Collaborator

Description

The type system expresses pointers as TypeRef::Pointer(TypeId), meaning we don't support pointer pointers (Pointer[Pointer[Int32]] for example). This can make working with C code tricky. In particular, if you have the expression mut some_value and some_value is a pointer, the return type is just Pointer[T], when in reality it's Pointer[Pointer[T]]. This can make debugging errors when interfacing with C code tricky.

To fix this, we probably have to change it to TypeRef::Pointer(Box<TypeRef>), but I'm not sure yet what the impact of that will be.

Related work

No response

@yorickpeterse yorickpeterse added feature New things to add to Inko, such as a new standard library module compiler Changes related to the compiler labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module
Projects
None yet
Development

No branches or pull requests

1 participant