Skip to content

Commit

Permalink
fix(lsp): Prevent crash on types not included from other modules (#2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
ospencer authored Aug 12, 2024
1 parent a4d9c61 commit 865da8a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions compiler/src/typed/env.re
Original file line number Diff line number Diff line change
Expand Up @@ -2481,12 +2481,11 @@ let rec get_type_path = type_expr => {
let get_type_definition_loc = (type_expr, env) => {
switch (get_type_path(type_expr)) {
| Some(path) =>
let decl = find_type(path, env);
if (decl.type_loc == Location.dummy_loc) {
None;
} else {
Some(decl.type_loc);
};
switch (find_type(path, env)) {
| exception Not_found => None
| {type_loc} when type_loc == Location.dummy_loc => None
| {type_loc} => Some(type_loc)
}
| _ => None
};
};
Expand Down

0 comments on commit 865da8a

Please sign in to comment.