Skip to content

Instantly share code, notes, and snippets.

@abcarroll
Created October 28, 2021 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abcarroll/f2544376d7fbab2c3e0eb443ad8b28da to your computer and use it in GitHub Desktop.
Save abcarroll/f2544376d7fbab2c3e0eb443ad8b28da to your computer and use it in GitHub Desktop.
fn testFnDecl()
{
let $x = 0;
let $y: int = 10;
let $z: string = "Hello World";
}
pub static fn testFnMore($a: int, $b: int): int
{
let $x = 5;
}
fn testFnAgain($a: int): string
{
let $z = 6;
}
fn complexTypeTest($a: map<string>, $b: string)
{
let $z = $a[ $b ];
return $z;
}
fn testIfCondAndComplexVarRef($x: int, $y: int)
{
let $r: int;
if $x > $y {
$r = $x;
}
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment