Fixed parsing of types.

This commit is contained in:
2017-06-16 04:21:19 +02:00
parent 30a092b365
commit 1876d1fe0b
5 changed files with 51 additions and 35 deletions

View File

@@ -128,16 +128,6 @@ At<Argument> deepCopy(At<Argument> &other)
return At<Argument>(other.timePoint, std::move(argument));
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
template<class Argument>
Either<Argument> deepCopy(Either<Argument> &other)
{
auto argument{deepCopy(other.argument)};
return Not<Argument>(std::move(argument));
}*/
////////////////////////////////////////////////////////////////////////////////////////////////////
template<class Argument>
@@ -152,20 +142,9 @@ Not<Argument> deepCopy(Not<Argument> &other)
// Variants
////////////////////////////////////////////////////////////////////////////////////////////////////
struct DeepCopyVisitor
{
template<class Argument>
Argument visit(Argument &other)
{
return deepCopy(other);
}
};
////////////////////////////////////////////////////////////////////////////////////////////////////
ast::Type deepCopy(ast::Type &other)
{
return other.match([](auto &x){deepCopy(x); return std::make_unique<ast::PrimitiveType>(nullptr);});
return other.match([](auto &x) -> ast::Type {return deepCopy(x);});
}
////////////////////////////////////////////////////////////////////////////////////////////////////