mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
add empty variable slice at index 0
This commit is contained in:
parent
a12114f0d8
commit
e86cc22024
1 changed files with 17 additions and 2 deletions
|
@ -49,7 +49,7 @@ struct ErrorTypeState {
|
|||
problems: Vec<crate::types::Problem>,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct Subs {
|
||||
utable: UnificationTable<InPlace<Variable>>,
|
||||
pub variables: Vec<Variable>,
|
||||
|
@ -59,6 +59,21 @@ pub struct Subs {
|
|||
pub variable_slices: Vec<VariableSubsSlice>,
|
||||
}
|
||||
|
||||
impl Default for Subs {
|
||||
fn default() -> Self {
|
||||
Subs {
|
||||
utable: Default::default(),
|
||||
variables: Default::default(),
|
||||
tag_names: Default::default(),
|
||||
field_names: Default::default(),
|
||||
record_fields: Default::default(),
|
||||
// store an empty slice at the first position
|
||||
// used for "TagOrFunction"
|
||||
variable_slices: vec![VariableSubsSlice::default()],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A slice into the Vec<T> of subs
|
||||
///
|
||||
/// The starting position is a u32 which should be plenty
|
||||
|
@ -883,7 +898,7 @@ pub enum Builtin {
|
|||
EmptyRecord,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
pub struct VariableSubsSlice {
|
||||
slice: SubsSlice<Variable>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue