diff options
author | John Hodge <tpg@mutabah.net> | 2016-06-06 15:13:46 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-06-06 15:13:46 +0800 |
commit | 15aabebe2ec4636d51656b786d56083703f2b393 (patch) | |
tree | f59561910d2cc4d5cac0e37be43dc94e89e3c175 /src/parse/root.cpp | |
parent | 62f8cff1c9113fe2ba90664a63e49a6edb13d371 (diff) | |
download | mrust-15aabebe2ec4636d51656b786d56083703f2b393.tar.gz |
HIR Typecheck - Method calls being planned, fixed resolution of Generic types
Diffstat (limited to 'src/parse/root.cpp')
-rw-r--r-- | src/parse/root.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index 15b792d0..847ffa75 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -273,11 +273,11 @@ AST::Function Parse_FunctionDef(TokenStream& lex, ::std::string abi, AST::MetaIt if( tok.type() == TOK_RWORD_MUT )
{
GET_CHECK_TOK(tok, lex, TOK_RWORD_SELF);
- args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), TypeRef(TypeRef::TagReference(), lex.end_span(ps), true, TypeRef("Self"))) );
+ args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), TypeRef(TypeRef::TagReference(), lex.end_span(ps), true, TypeRef("Self", 0xFFFF))) );
}
else
{
- args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), TypeRef(TypeRef::TagReference(), lex.end_span(ps), false, TypeRef("Self"))) );
+ args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), TypeRef(TypeRef::TagReference(), lex.end_span(ps), false, TypeRef("Self", 0xFFFF))) );
}
DEBUG("TODO: UFCS / self lifetimes");
if( allow_self == false )
@@ -309,7 +309,7 @@ AST::Function Parse_FunctionDef(TokenStream& lex, ::std::string abi, AST::MetaIt }
else {
PUTBACK(tok, lex);
- ty = TypeRef("Self");
+ ty = TypeRef("Self", 0xFFFF);
}
args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), ty) );
GET_TOK(tok, lex);
@@ -327,7 +327,7 @@ AST::Function Parse_FunctionDef(TokenStream& lex, ::std::string abi, AST::MetaIt }
else {
PUTBACK(tok, lex);
- ty = TypeRef("Self");
+ ty = TypeRef("Self", 0xFFFF);
}
args.push_back( ::std::make_pair( AST::Pattern(AST::Pattern::TagBind(), "self"), ty) );
GET_TOK(tok, lex);
@@ -634,8 +634,8 @@ AST::Trait Parse_TraitDef(TokenStream& lex, AST::Module& mod, const AST::MetaIte if( GET_TOK(tok, lex) == TOK_COLON )
{
// Bounded associated type
- TypeRef a_type = TypeRef( Span(), AST::Path(AST::Path::TagUfcs(), TypeRef(TypeRef::TagArg(), "Self"), AST::Path(), {AST::PathNode(name)}) );
- //TypeRef a_type = TypeRef(TypeRef::TagAssoc(), TypeRef(TypeRef::TagArg(), "Self"), TypeRef(), name);
+ TypeRef a_type = TypeRef( Span(), AST::Path(AST::Path::TagUfcs(), TypeRef("Self", 0xFFFF), AST::Path(), {AST::PathNode(name)}) );
+ //TypeRef a_type = TypeRef(TypeRef::TagAssoc(), TypeRef("Self", 0xFFFF), TypeRef(), name);
Parse_TypeBound(lex, params, a_type);
GET_TOK(tok, lex);
}
|