Type check pointer dereferencing

This commit is contained in:
2024-05-16 21:01:11 +02:00
parent 30e84f1cdd
commit 3f13adcfe7
9 changed files with 185 additions and 9 deletions

View File

@ -1,5 +1,4 @@
#include "elna/source/result.hpp"
#include "elna/source/types.hpp"
namespace elna::source
{
@ -33,4 +32,15 @@ namespace elna::source
{
return "Name '" + name + "' was already defined";
}
type_mismatch::type_mismatch(std::shared_ptr<const type> got, operation kind, const std::filesystem::path& path,
const struct position position)
: error(path, position), kind(kind), got(got)
{
}
std::string type_mismatch::what() const
{
return "Type cannot be used here.";
}
}