Types in constants and variables for definitions.

This commit is contained in:
Stephen Chung
2022-09-08 10:53:55 +08:00
parent 2f7d6298e0
commit 040f28f5cd
9 changed files with 37 additions and 15 deletions

View File

@@ -1,3 +1,5 @@
module static;
let hello_there;
let hello_there: string;
const HELLO: string;

View File

@@ -693,7 +693,7 @@ fn all(array: Array, filter: FnPtr) -> bool;
/// let x = [1, 2, 3];
/// let y = [true, 'x'];
///
/// x.push(y);
/// x.append(y);
///
/// print(x); // prints "[1, 2, 3, true, 'x']"
/// ```

View File

@@ -1,4 +1,6 @@
module general_kenobi;
const CONSTANT: int;
/// Returns a string where "hello there" is repeated `n` times.
fn hello_there(n: int) -> String;