Repository navigation
Implement generic function calls and declarations - #442
Merged
Merged
Conversation
CohenArthur
force-pushed
the
function-call-generics-pass
branch
from
December 26, 2021 18:40
ea1570e to
1bed0fa
Compare
Member
Author
func id[T](x: T) -> T { x }
id[string]("hey")
id[float](15.4)
b = true
func ret_bool() -> bool {
{
if b {
b
} else {
false
}
}
}
func returns_bool() -> bool {
ret_bool()
}
if id[bool](returns_bool()) {
println("Yay")
} else {
println("Nay")
}fails typechecking with the following error Error type: Typechecker
===> test.jk
|
| if condition should be a boolean, not a `void`
| |
Member
Author
|
We probably need to add a new variant to checked type such as |
CohenArthur
force-pushed
the
function-call-generics-pass
branch
from
December 27, 2021 09:45
1bed0fa to
d5784ad
Compare
CohenArthur
force-pushed
the
function-call-generics-pass
branch
from
December 27, 2021 22:40
d5784ad to
6fb503b
Compare
CohenArthur
force-pushed
the
function-call-generics-pass
branch
from
December 27, 2021 23:11
61c67c9 to
a524ad7
Compare
Member
Author
|
This PR should stay up while we iron out the different ways to actually obtain generic function calls. Passing the three easy tests in |
CohenArthur
force-pushed
the
function-call-generics-pass
branch
from
December 27, 2021 23:18
a524ad7 to
01672c8
Compare
Expand return type properly in generic functions
Do not declare generic functions twice
Typecheck generated function
…ctions Expand generics in more instructions
Member
Author
|
I think the only missing piece for a correct base is to fix #459 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.