Add better error raporting
This commit is contained in:
parent
28483812ea
commit
51c54e375a
@ -25,8 +25,11 @@ namespace {
|
|||||||
if (types::types_equal(checked, target)) {
|
if (types::types_equal(checked, target)) {
|
||||||
return TypecheckRes{ TypecheckResKind::Ok, target };
|
return TypecheckRes{ TypecheckResKind::Ok, target };
|
||||||
}
|
}
|
||||||
else if (potential_cast.has_value() && potential_cast->allow_implicit) {
|
else if (potential_cast.has_value()) {
|
||||||
return TypecheckRes{ TypecheckResKind::Castable, target };
|
if (potential_cast->allow_implicit)
|
||||||
|
return TypecheckRes{ TypecheckResKind::Castable, target };
|
||||||
|
|
||||||
|
return std::string{ "Type " + checked->formatted() + " not implicitly castable to " + target->formatted() };
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::string{ "Types " + checked->formatted() + " and " + target->formatted() + " incompatible" };
|
return std::string{ "Types " + checked->formatted() + " and " + target->formatted() + " incompatible" };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user