diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-29 08:50:39 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-29 08:50:39 +0800 |
commit | a8d2de3db9d9f92013d0ac6e52319b55590efea4 (patch) | |
tree | 1f85c37a21df5379518f2567a34eb3f174cb790f /src/ast/ast.cpp | |
parent | 727e254fe58274741036ca31f4c3eae2f3e1695a (diff) | |
download | mrust-a8d2de3db9d9f92013d0ac6e52319b55590efea4.tar.gz |
AST - Remove dead code, add lifetime params, fix param clobber
Diffstat (limited to 'src/ast/ast.cpp')
-rw-r--r-- | src/ast/ast.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index 802bde37..77981a4d 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -495,34 +495,6 @@ SERIALISE_TYPE(Enum::, "AST_Enum", { s.item(m_variants);
})
-TypeRef Struct::get_field_type(const char *name, const ::std::vector<TypeRef>& args)
-{
- if( args.size() != m_params.ty_params().size() )
- {
- throw ::std::runtime_error("Incorrect parameter count for struct");
- }
- // TODO: Should the bounds be checked here? Or is the count sufficient?
- for(const auto& f : m_data.as_Struct().ents)
- {
- if( f.m_name == name )
- {
- // Found it!
- if( args.size() )
- {
- TypeRef res = f.m_type;
- res.resolve_args( GenericResolveClosure(m_params, args) );
- return res;
- }
- else
- {
- return f.m_type;
- }
- }
- }
-
- throw ::std::runtime_error(FMT("No such field " << name));
-}
-
SERIALISE_TYPE(Struct::, "AST_Struct", {
s << m_params;
s << m_data;
|