[fine] Check the return type of functions
A function returns what it says it does, the check is that the body returns the right value.
This commit is contained in:
parent
257a7e64c2
commit
d893002ec2
5 changed files with 70 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
fun test() {
|
||||
fun test() -> f64 {
|
||||
1 * 2 + -3 * 4
|
||||
}
|
||||
|
||||
|
|
@ -13,6 +13,10 @@ fun test() {
|
|||
// | ParamList
|
||||
// | LeftParen:'"("'
|
||||
// | RightParen:'")"'
|
||||
// | ReturnType
|
||||
// | Arrow:'"->"'
|
||||
// | TypeExpression
|
||||
// | Identifier:'"f64"'
|
||||
// | Block
|
||||
// | LeftBrace:'"{"'
|
||||
// | ExpressionStatement
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue