-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
18 changes: 18 additions & 0 deletions
18
crates/analyzer/tests/snapshots/errors__uninit_values.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: crates/analyzer/tests/errors.rs | ||
expression: "error_string(&path, test_files::fixture(path))" | ||
|
||
--- | ||
error: uninitialized variable | ||
┌─ compile_errors/uninit_values.fe:7:13 | ||
│ | ||
7 │ let my_struct: MyStruct | ||
│ ^^^^^^^^^ uninitialized variable | ||
|
||
error: uninitialized variable | ||
┌─ compile_errors/uninit_values.fe:8:13 | ||
│ | ||
8 │ let my_array: Array<u256, 42> | ||
│ ^^^^^^^^ uninitialized variable | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
crates/test-files/fixtures/compile_errors/uninit_values.fe
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
struct MyStruct { | ||
x: u256 | ||
} | ||
|
||
contract Foo { | ||
pub fn foo() { | ||
let my_struct: MyStruct | ||
let my_array: Array<u256, 42> | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
contract Foo { | ||
pub fn foo() -> Array<u256, 4> { | ||
let my_array: Array<u256, 4> = [8; 4] | ||
my_array[1] = 42 | ||
return my_array | ||
} | ||
} |
This file contains 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