-
-
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.
cgen: fix type_default for array init >= 8 items (spotted while build…
…ing the vhamll project) (#23334)
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
struct Foo { | ||
pub mut: | ||
integer_range_for_discrete []int = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | ||
} | ||
|
||
fn foo(a string) Foo { | ||
return match a { | ||
'a' { Foo{} } | ||
else { panic('foo') } | ||
} | ||
} | ||
|
||
fn test_main() { | ||
assert foo('a') == Foo{} | ||
} |