mirror of
https://github.com/tweag/nickel.git
synced 2024-10-04 23:27:15 +03:00
parent
e87e7f438e
commit
7a4d3b5dcf
@ -337,7 +337,7 @@ RecordField: (FieldPath, RichTerm) = {
|
||||
if let Some(deft) = t {
|
||||
deft
|
||||
} else {
|
||||
RichTerm::new(Term::Null, pos)
|
||||
RichTerm::new(Term::MetaValue(MetaValue::new()), pos)
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -49,3 +49,19 @@ fn dynamic_not_recursive() {
|
||||
Err(Error::TypecheckError(TypecheckError::UnboundIdentifier(..)))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_field() {
|
||||
assert_matches!(
|
||||
eval("{foo | Num, bar = foo + 1}.foo"),
|
||||
Err(Error::EvalError(EvalError::MissingFieldDef(..)))
|
||||
);
|
||||
assert_matches!(
|
||||
eval("{foo : Num, bar = foo + 1}.foo"),
|
||||
Err(Error::EvalError(EvalError::MissingFieldDef(..)))
|
||||
);
|
||||
assert_matches!(
|
||||
eval("{foo, bar = foo + 1}.foo"),
|
||||
Err(Error::EvalError(EvalError::MissingFieldDef(..)))
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user