summaryrefslogtreecommitdiff
path: root/src/parse/token.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/token.cpp')
-rw-r--r--src/parse/token.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parse/token.cpp b/src/parse/token.cpp
index 37515a2e..05ded69f 100644
--- a/src/parse/token.cpp
+++ b/src/parse/token.cpp
@@ -71,7 +71,7 @@ Token::Token(const InterpolatedFragment& frag)
case InterpolatedFragment::TT: throw "";
case InterpolatedFragment::TYPE:
m_type = TOK_INTERPOLATED_TYPE;
- m_data = new TypeRef( *reinterpret_cast<const TypeRef*>(frag.m_ptr) );
+ m_data = new TypeRef( reinterpret_cast<const TypeRef*>(frag.m_ptr)->clone() );
break;
case InterpolatedFragment::PAT:
m_type = TOK_INTERPOLATED_PATTERN;
@@ -179,7 +179,7 @@ Token Token::clone() const
switch(m_type)
{
case TOK_INTERPOLATED_TYPE:
- rv.m_data = new TypeRef( *reinterpret_cast<TypeRef*>(e) );
+ rv.m_data = new TypeRef( reinterpret_cast<TypeRef*>(e)->clone() );
break;
case TOK_INTERPOLATED_PATTERN:
rv.m_data = new AST::Pattern( reinterpret_cast<AST::Pattern*>(e)->clone() );