summaryrefslogtreecommitdiff
path: root/src/expr/declaration_scope.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/declaration_scope.cpp')
-rw-r--r--src/expr/declaration_scope.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/expr/declaration_scope.cpp b/src/expr/declaration_scope.cpp
index 8dd329b83..79accf43a 100644
--- a/src/expr/declaration_scope.cpp
+++ b/src/expr/declaration_scope.cpp
@@ -144,7 +144,10 @@ Type DeclarationScope::lookupType(const std::string& name,
Debug("sort") << "instance is " << instantiation << endl;
return instantiation;
- } else {
+ }else if( p.second.isDatatype() ){
+ Assert( DatatypeType( p.second ).isParametric() );
+ return DatatypeType(p.second).instantiate(params);
+ }else {
if(Debug.isOn("sort")) {
Debug("sort") << "instantiating using a sort substitution" << endl;
Debug("sort") << "have formals [";
@@ -167,6 +170,11 @@ Type DeclarationScope::lookupType(const std::string& name,
}
}
+size_t DeclarationScope::lookupArity( const std::string& name ){
+ pair<vector<Type>, Type> p = (*d_typeMap->find(name)).second;
+ return p.first.size();
+}
+
void DeclarationScope::popScope() throw(ScopeException) {
if( d_context->getLevel() == 0 ) {
throw ScopeException();
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback