diff --git a/libsolidity/experimental/analysis/TypeInference.cpp b/libsolidity/experimental/analysis/TypeInference.cpp index e89c9dd2d8f7..519087ac4606 100644 --- a/libsolidity/experimental/analysis/TypeInference.cpp +++ b/libsolidity/experimental/analysis/TypeInference.cpp @@ -479,7 +479,10 @@ experimental::Type TypeInference::handleIdentifierByReferencedDeclaration(langut else if (dynamic_cast(&_declaration)) return polymorphicInstance(*declarationAnnotation.type); else if (dynamic_cast(&_declaration)) - return polymorphicInstance(*declarationAnnotation.type); + { + solAssert(TypeEnvironmentHelpers{*m_env}.typeVars(*declarationAnnotation.type).empty()); + return *declarationAnnotation.type; + } else if (dynamic_cast(&_declaration)) { // TODO: can we avoid this?