summaryrefslogtreecommitdiff
path: root/src/ast/path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast/path.cpp')
-rw-r--r--src/ast/path.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ast/path.cpp b/src/ast/path.cpp
index a868be5d..0bce09c1 100644
--- a/src/ast/path.cpp
+++ b/src/ast/path.cpp
@@ -213,7 +213,18 @@ void Path::bind_enum_var(const Enum& ent, const ::std::string& name, const ::std
}
void Path::bind_struct(const Struct& ent, const ::std::vector<TypeRef>& args)
{
- throw ParseError::Todo("Path::resolve() bind to struct type");
+ if( args.size() > 0 )
+ {
+ if( args.size() != ent.params().size() )
+ throw ParseError::Generic("Parameter count mismatch");
+ // TODO: Is it the role of this section of code to ensure that the passed args are valid?
+ // - Probably not, it should instead be the type checker that does it
+ // - Count validation is OK here though
+ }
+
+ DEBUG("Bound to struct");
+ m_binding_type = STRUCT;
+ m_binding.struct_ = &ent;
}
void Path::bind_static(const Static& ent)
{