Skip to content

Commit

Permalink
switch invalid term from type to domain error
Browse files Browse the repository at this point in the history
  • Loading branch information
Skgland committed Aug 5, 2024
1 parent deed6fb commit 058b9c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/machine/machine_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pub(crate) enum ValidType {
Callable,
Character,
Compound,
Directive,
Evaluable,
Float,
InByte,
Expand Down Expand Up @@ -74,7 +73,6 @@ impl ValidType {
// ValidType::PredicateIndicator => atom!("predicate_indicator"),
// ValidType::Variable => atom!("variable")
ValidType::TcpListener => atom!("tcp_listener"),
ValidType::Directive => atom!("directive"),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,8 +981,8 @@ impl MachineState {

pub(crate) fn directive_error(&mut self, err: DirectiveError) -> MachineError {
match err {
DirectiveError::ExpectedDirective(_term) => self.type_error(
ValidType::Directive,
DirectiveError::ExpectedDirective(_term) => self.domain_error(
DomainErrorType::Directive,
atom_as_cell!(atom!("todo_insert_invalid_term_here")),
),
DirectiveError::InvalidDirective(name, arity) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/scryer/cli/src_tests/directive_errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ scryer-prolog -f --no-add-history tests-pl/invalid_decl5.pl -g halt

```trycmd
$ scryer-prolog -f --no-add-history tests-pl/invalid_decl6.pl -g halt
error(type_error(directive,todo_insert_invalid_term_here),load/1).
error(domain_error(directive,todo_insert_invalid_term_here),load/1).
```

Expand Down

0 comments on commit 058b9c5

Please sign in to comment.