mirror of https://github.com/tbklang/tlang.git
🐞️ Functions: Expressionless return and enforcing requirement #113
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 2 hours 22 minutes
Due Date
deavmi
2 hours 22 minutes
Depends on
#114 🐞️ isSameType: Add a base case
tlang/tlang
You do not have permission to read 1 dependency
Reference: tlang/tlang#113
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Bugfix 🐞️: Expressionless
return
Allow a
return
without an expression:expressionPass(null)
(on null)void
type then no expression can be presentvoid
function declarationsparseBody()
call in it and that feels wrong.ReturnStmt
in the typechecker/code gen what it'sparentOf
is and then that would allow us, for ANYreturn
statement to ensure it is in aContainer
that is aFunction
onlyparseBody()
, I don't have an example fo wehere we useparseBody()
in a non-function, thereore so far having such a check wouldn't matter actually. I don't necessarily feels as though this is bad because if for some reason we did come up with some structure that usedparseBody()
but would not allowreturn
in it then this would be a good way to check for it.return
expression.As of commit
4facc5a3f0f32eae1a5fe8c1e0a3809e4cfddf49
we have added support for expressionless returns in the parser and CI/CD checks out ✅As of commit
98f6c03d22457b63f1998b3c9056a05a587e72f2
we have added a check in the dependency generator to only doexpressionPass()
when theReturnStmt
has an expression.Running
typecheck
test in CI passes ✅ , so this is goodGoing to bring this branch's base up-to-date.
Done and CI fails where it normally did ✅
Not continueing this until I get universal coercion working as that makes sense to do rather than coerce everywhere where I could.
Taking a look at this again...
Looks good to me
Fixed merge conflict 👍
Awaiting CI/CD...
bugfix/return_typeto vardec_varass_dependencyvardec_varass_dependencyto vardec_varass_dependencyFixed the lookup of the
ReturnStmt
's nearestFunction
-basedContainer
.This will now continue on the
feature/universal_coercion
branch so I can do the type checking part.vardec_varass_dependencyto feature/universal_coercionWorking on merge conflicts now...
Merged 👍
Added a TODO where the type enforcement needs to go
Type enforcement added in commit
0a4cec2013d932c7b4e33a8a7508002047f94db4
on thefeature/universal_coercion
branchInitial CI/CD all green ✅
Added two new test cases:
simple_function_return_type_check_bad.t
simple_function_return_type_check_good.t
In commit
dd66d2e47e6910bc10634f9a26814a97c7fcf830
in branch as above 2nd last comment to this oneCI/CD all good ✅
Last bullet point that I need to look at now
Accounted for via:
All done on commit
b01ff34daadcdc53c43d650500f3ebb9a9cc0457
CI/CD :chec