Support 'unowned var' (unowned compiler-typed variables)
Submitted by Travis Reitter
Link to original bug (#638199)
Description
valac currently doesn't support unowned auto-typed variables.
This leads to odd development patterns -- the 'preamble' for a variable can flip more than a single keyword at a time when optimizing types (whether for readability, fewest copies, etc.). Eg,
var bar = func_that_allocates_result ();
-> unowned FooType bar = func_that_does_not_allocate_result ();
Whereas if we supported unowned var, a return type change on the right side would look like:
var bar = func_that_allocates_result ();
-> unowned var bar = func_that_does_not_allocate_result ();
Ideally, we would use 'var' type for all variables that are declared and assigned to in the same line (whether or not they're unowned).
Version: 0.18.x