feat(library/class): allow transitive instances that have instances arguments
This commit is contained in:
parent
9a9e975bc8
commit
880f212494
1 changed files with 5 additions and 5 deletions
|
@ -290,13 +290,13 @@ static pair<name, name> get_source_target(environment const & env, type_checker
|
|||
if (!tgt)
|
||||
throw exception(sstream() << "invalid transitive instance, resulting type of '" << n << "' is not a class");
|
||||
optional<name> src;
|
||||
for (expr const & d : domain) {
|
||||
unsigned i = domain.size();
|
||||
while (i > 0) {
|
||||
--i;
|
||||
expr const & d = domain[i];
|
||||
if (auto it = is_ext_class(tc, mlocal_type(d))) {
|
||||
if (src) {
|
||||
throw exception(sstream() << "invalid transitive instance, '" << n
|
||||
<< "' has more than one instance argument");
|
||||
}
|
||||
src = it;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!src)
|
||||
|
|
Loading…
Reference in a new issue