1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//! > Test for
//! > test_runner_name
test_expr_semantics(expect_diagnostics: false)
//! > function_body
//! > expr_code
for _a in array![1, 2].span() {
break;
}
//! > expected_semantics
For(
ExprFor {
into_iter: core::array::SpanIntoIterator::<core::felt252>::into_iter,
into_iter_member_path: LocalVarId(test::in),
next_function_id: core::array::SpanIterator::<core::felt252>::next,
expr_id: FunctionCall(
ExprFunctionCall {
function: core::array::ArrayToSpan::<core::felt252>::span,
args: [
Value(
Snapshot(
ExprSnapshot {
inner: Block(
ExprBlock {
statements: [
Let(
StatementLet {
pattern: Variable(
__array_builder_macro_result__,
),
expr: FunctionCall(
ExprFunctionCall {
function: core::array::ArrayImpl::<core::felt252>::new,
args: [],
coupon_arg: None,
ty: core::array::Array::<core::felt252>,
},
),
else_clause: None,
},
),
Expr(
StatementExpr {
expr: FunctionCall(
ExprFunctionCall {
function: core::array::ArrayImpl::<core::felt252>::append,
args: [
Reference(
LocalVarId(test::__array_builder_macro_result__),
),
Value(
Literal(
ExprNumericLiteral {
value: 1,
ty: core::felt252,
},
),
),
],
coupon_arg: None,
ty: (),
},
),
},
),
Expr(
StatementExpr {
expr: FunctionCall(
ExprFunctionCall {
function: core::array::ArrayImpl::<core::felt252>::append,
args: [
Reference(
LocalVarId(test::__array_builder_macro_result__),
),
Value(
Literal(
ExprNumericLiteral {
value: 2,
ty: core::felt252,
},
),
),
],
coupon_arg: None,
ty: (),
},
),
},
),
],
tail: Some(
Var(
LocalVarId(test::__array_builder_macro_result__),
),
),
ty: core::array::Array::<core::felt252>,
},
),
ty: @core::array::Array::<core::felt252>,
},
),
),
],
coupon_arg: None,
ty: core::array::Span::<core::felt252>,
},
),
pattern: Variable(
_a,
),
body: Block(
ExprBlock {
statements: [
Break(
StatementBreak {
expr_option: None,
},
),
],
tail: None,
ty: (),
},
),
ty: (),
},
)
//! > expected_diagnostics