-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
checker, cgen: fix const initialized with array (#21131)
- Loading branch information
Showing
3 changed files
with
21 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
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
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,17 @@ | ||
const some_arr = make_array() | ||
const some_arr2 = make_array2() | ||
|
||
fn make_array() [64]u8 { | ||
mut arr := [64]u8{} | ||
return arr | ||
} | ||
|
||
fn make_array2() []u8 { | ||
mut arr := []u8{} | ||
return arr | ||
} | ||
|
||
fn test_main() { | ||
assert some_arr.len == 64 | ||
assert some_arr2.len == 0 | ||
} |