Constrain string interpolation

This commit is contained in:
Richard Feldman 2020-08-29 21:37:46 -04:00
parent 5080a7e24b
commit 274e7e786d
11 changed files with 150 additions and 180 deletions

View file

@ -151,10 +151,9 @@ impl Variable {
pub const EMPTY_TAG_UNION: Variable = Variable(2);
// Builtins
const BOOL_ENUM: Variable = Variable(3);
pub const BOOL: Variable = Variable(4);
pub const LIST_GET: Variable = Variable(5);
pub const BOOL: Variable = Variable(4); // Used in `if` conditions
pub const NUM_RESERVED_VARS: usize = 6;
pub const NUM_RESERVED_VARS: usize = 5;
const FIRST_USER_SPACE_VAR: Variable = Variable(Self::NUM_RESERVED_VARS as u32);

View file

@ -904,7 +904,7 @@ pub enum Reason {
FloatLiteral,
IntLiteral,
NumLiteral,
InterpolatedStringVar,
StrInterpolation,
WhenBranch {
index: Index,
},
@ -930,6 +930,7 @@ pub enum Category {
TagApply(TagName),
Lambda,
Uniqueness,
StrInterpolation,
// storing variables in the ast
Storage,