We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5f679f commit ed9a6f4Copy full SHA for ed9a6f4
starlark/src/eval/bc/compiler/stmt.rs
@@ -194,14 +194,12 @@ impl IrSpanned<StmtCompiled> {
194
expr.write_bc_cb(bc, |slot, bc| {
195
bc.write_instr::<InstrReturnCheckType>(span, slot);
196
});
197
+ } else if let Some(value) = expr.as_value() {
198
+ bc.write_instr::<InstrReturnConst>(span, value);
199
} else {
- if let Some(value) = expr.as_value() {
- bc.write_instr::<InstrReturnConst>(span, value);
200
- } else {
201
- expr.write_bc_cb(bc, |slot, bc| {
202
- bc.write_instr::<InstrReturn>(span, slot);
203
- });
204
- }
+ expr.write_bc_cb(bc, |slot, bc| {
+ bc.write_instr::<InstrReturn>(span, slot);
+ });
205
}
206
207
0 commit comments