Closed WardBrian closed 2 years ago
This cleans up the code nicely but I thought the plan has been to add unsized local variables to the language? Have you discussed this with Bob?
@bob-carpenter and I both seem to think now that something like auto
or var
from Java would be better than unsized declarations, for what it is worth.
If we do decide to add unsized declarations then reverting this change is just as easy as making it, but leaving this code there "just in case" seems unnecessary to me
We currently have the type of VarDecl set up so that it could hold an unsized type. This is never done in the AST, and leads to a lot of unecessary hand-wringing, like this unreachable code in the typechecker:
We cannot do the same in the MIR, since certain optimizations actually can produce unsized declarations, namely function inlining
1097
Submission Checklist
Release notes
Internally clean up how variable declarations are represented.
Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)