-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
all: make type of mut
function args and loop values consistent
#8802
Conversation
@UweKrueger I hope the conflict can be resolved as soon as possible and the merger can take place as soon as possible! |
Only CI failure was in MacOS compiling V UI - that's been fixed now, hasn't it? Taking care of the conflicts should allow this to be ready to merge. |
@JalonSolov Unfortunately it's not that trivial. A lot of code has been contributed in the last few weeks that causes semantic conflicts. |
Any progress? :/ |
Function arguments, receivers and
for
loop variables that are declaredmut
are references behind the scenes. However it is not clear what their logical type is, i.e. if the behave like values or like references. The present state is like this:This is an inconsistent behaviour, which is made possible by a bunch of exceptions in
checker
andcgen
.This PR changes the state of
mut
arguments so that they are logically pure values. In particulartypeof(y).name
would becomeSt
andreturn &y
would be required. This eventually reduces the number of exceptions required inchecker
and limits them tocgen
. (At the present state there are some exception that had to be introduced inchecker
to make existing code continue to work, but these will become warnings and can be removed later.)This fixes #11038.