Skip to content

Commit

Permalink
Improve error locating on resolve_type_by_name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Apr 26, 2024
1 parent daa7240 commit 1e91e7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/resolver/type_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::rc::Rc;

use itertools::Itertools;

use crate::error::{RResult, RuntimeError};
use crate::error::{ErrInRange, RResult, RuntimeError};
use crate::interpreter::runtime::Runtime;
use crate::resolver::scopes;
use crate::program::function_object::FunctionTargetType;
Expand Down Expand Up @@ -58,7 +58,11 @@ impl <'a> TypeFactory<'a> {
return Err(RuntimeError::error("Interpreted types aren't supported yet; please use an explicit type for now. 2 ").to_array());
};

let term: &ast::Term = &pterm.value;
self.resolve_type_by_name(allow_anonymous_generics, &pterm.value)
.err_in_range(&pterm.position)
}

fn resolve_type_by_name(&mut self, allow_anonymous_generics: bool, term: &ast::Term) -> RResult<Rc<TypeProto>> {
let arguments = vec![];

let ast::Term::Identifier(type_name) = term else {
Expand Down

0 comments on commit 1e91e7d

Please sign in to comment.