Changeset View
Changeset View
Standalone View
Standalone View
duchain/expressionvisitor.cpp
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 114 | { | |||
---|---|---|---|---|---|
148 | else if ( !actualDeclaration ) { | 148 | else if ( !actualDeclaration ) { | ||
149 | setConfident(false); | 149 | setConfident(false); | ||
150 | return encounterUnknown(); | 150 | return encounterUnknown(); | ||
151 | } | 151 | } | ||
152 | 152 | | |||
153 | DUChainReadLocker lock; | 153 | DUChainReadLocker lock; | ||
154 | actualDeclaration = Helper::resolveAliasDeclaration(actualDeclaration); | 154 | actualDeclaration = Helper::resolveAliasDeclaration(actualDeclaration); | ||
155 | ClassDeclaration* classDecl = dynamic_cast<ClassDeclaration*>(actualDeclaration); | 155 | ClassDeclaration* classDecl = dynamic_cast<ClassDeclaration*>(actualDeclaration); | ||
156 | QPair<FunctionDeclarationPointer, bool> d = Helper::functionDeclarationForCalledDeclaration( | 156 | auto function = Helper::functionForCalled(actualDeclaration); | ||
157 | DeclarationPointer(actualDeclaration)); | | |||
158 | FunctionDeclaration* funcDecl = d.first.data(); | | |||
159 | bool isConstructor = d.second; | | |||
160 | lock.unlock(); | 157 | lock.unlock(); | ||
161 | 158 | | |||
162 | if ( funcDecl && funcDecl->type<FunctionType>() ) { | 159 | if ( function.declaration && function.declaration->type<FunctionType>() ) { | ||
163 | // try to deduce type from a decorator | 160 | // try to deduce type from a decorator | ||
164 | checkForDecorators(node, funcDecl, classDecl, isConstructor); | 161 | checkForDecorators(node, function.declaration, classDecl, function.isConstructor); | ||
165 | } | 162 | } | ||
166 | else if ( classDecl ) { | 163 | else if ( classDecl ) { | ||
167 | return encounter(classDecl->abstractType(), DeclarationPointer(classDecl)); | 164 | return encounter(classDecl->abstractType(), DeclarationPointer(classDecl)); | ||
168 | } | 165 | } | ||
169 | else { | 166 | else { | ||
170 | if ( actualDeclaration ) { | 167 | if ( actualDeclaration ) { | ||
171 | qCDebug(KDEV_PYTHON_DUCHAIN) << "Declaraton is not a class or function declaration"; | 168 | qCDebug(KDEV_PYTHON_DUCHAIN) << "Declaraton is not a class or function declaration"; | ||
172 | } | 169 | } | ||
▲ Show 20 Lines • Show All 534 Lines • Show Last 20 Lines |