Add better error raporting
This commit is contained in:
parent
28483812ea
commit
51c54e375a
@ -25,8 +25,11 @@ namespace {
|
||||
if (types::types_equal(checked, target)) {
|
||||
return TypecheckRes{ TypecheckResKind::Ok, target };
|
||||
}
|
||||
else if (potential_cast.has_value() && potential_cast->allow_implicit) {
|
||||
return TypecheckRes{ TypecheckResKind::Castable, target };
|
||||
else if (potential_cast.has_value()) {
|
||||
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" };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user