Skip to content

Commit

Permalink
Give an error message with a location for ambiguous types.
Browse files Browse the repository at this point in the history
  • Loading branch information
bredelings committed Jan 9, 2025
1 parent b5d27bf commit 6e14971
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/computation/rename/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,15 @@ Hs::LTypeCon renamer_state::rename_type(Hs::LTypeCon ltc)

if (m.type_is_declared(name))
{
auto T = m.lookup_type(name);
name = T->name;
try
{
auto T = m.lookup_type(name);
name = T->name;
}
catch (myexception& e)
{
error(loc, Note()<<e.what());
}
}
else
error(loc, Note()<<"Undeclared type constructor `"<<name<<"`");
Expand Down

0 comments on commit 6e14971

Please sign in to comment.