Skip to content

Commit 15021ff

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Add clarifying assertion
Reviewed By: IanChilds Differential Revision: D48940697 fbshipit-source-id: 19ed17f500b02a6788aab28ac7df9f8cbe6c3cee
1 parent 3886dae commit 15021ff

File tree

1 file changed

+3
-1
lines changed
  • starlark/src/eval/compiler/scope

1 file changed

+3
-1
lines changed

starlark/src/eval/compiler/scope/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,9 @@ impl<'f> ModuleScopeBuilder<'f> {
814814
if self.locals.len() > 1 {
815815
binding.captured = Captured::Yes;
816816
}
817-
Some((binding.resolved_slot(&self.codemap).unwrap(), binding_id))
817+
let slot = binding.resolved_slot(&self.codemap).unwrap();
818+
assert!(matches!(slot, Slot::Module(_)));
819+
Some((slot, binding_id))
818820
}
819821
None => None,
820822
}

0 commit comments

Comments
 (0)