mirror of
https://github.com/tbklang/tlang.git
synced 2024-09-21 05:22:50 +02:00
🐞️ Bugfix: Statement-level FunctionCall have wrong weighting #193
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
tir
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 19 minutes 24 seconds
Due Date
deavmi
19 minutes 24 seconds
Dependencies
No dependencies set.
Reference: tlang/tlang#193
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose ✍️
If you have the below code and attempt to typecheck/codegen it:
Then you get an error saying that
arr
is trying to be fereneced prior toarr
being declared. The only way this is happening is because the function call is re-ordered to appear first and hence the error makes sense then.Solution ✅
There is no weighting value for the
FunctionCall
, set it to 2 in the constructor.Checklist 🗒️
FunctionCall
fixCompiler
unittestsBackport: FunctioNCall standalone werightingto 🐞️ Bugfix: Statement-level FunctionCall have wrong weightingFunctionCall
2
such that when this is used as a standalone statement-level call that is stays in its proper place, and doesn't (for example) jump prior to variable declarationsCompiler (unittests)
simple_func_statement.t
Test cases
simple_func_statement.t
Pipelines
simple_func_statement.t
Waiting for Github CI/CD now...
All done ✅
Going to get this in now...
Merged ✅