-
Notifications
You must be signed in to change notification settings - Fork 244
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
Mutable types #1421
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jakt currently does not track mutability of types. Instead, it awkwardly conflates mutability of bindings with mutability of types.
We should split a type
T
intoT
andmut T
. This would map toT const
andT
in the generated C++.let x = get_some<mut T>()
should create an immutable binding to amut T
mut x = get_some<T>()
should create a mutable binding to aT
Mutation method calls should only be allowed on
mut T
values, notT
.Passing a
mut T
to a function parameter of typeT
should be allowed.There are probably other details that need figuring out.
The text was updated successfully, but these errors were encountered: