Changeset View
Changeset View
Standalone View
Standalone View
duchain/expressionvisitor.cpp
Context not available. | |||||
31 | #include <language/duchain/types/functiontype.h> | 31 | #include <language/duchain/types/functiontype.h> | ||
---|---|---|---|---|---|
32 | #include <language/duchain/types/integraltype.h> | 32 | #include <language/duchain/types/integraltype.h> | ||
33 | #include <language/duchain/types/structuretype.h> | 33 | #include <language/duchain/types/structuretype.h> | ||
34 | #include <language/duchain/types/unsuretype.h> | ||||
34 | 35 | | |||
35 | #include "duchaindebug.h" | 36 | #include "duchaindebug.h" | ||
36 | 37 | | |||
Context not available. | |||||
226 | forever { | 227 | forever { | ||
227 | AbstractType::Ptr type; | 228 | AbstractType::Ptr type; | ||
228 | if (it->element->parameterType) { | 229 | if (it->element->parameterType) { | ||
229 | //don't use openTypeFromName as it uses cursor for findDeclarations | 230 | auto parameterType = it->element->parameterType; | ||
230 | DeclarationPointer decl = findDeclarationImport(ClassDeclarationType, | 231 | if (parameterType->objectType) { | ||
231 | identifierForNamespace(it->element->parameterType, m_editor)); | 232 | //don't use openTypeFromName as it uses cursor for findDeclarations | ||
232 | if (decl) { | 233 | DeclarationPointer decl = findDeclarationImport(ClassDeclarationType, | ||
233 | type = decl->abstractType(); | 234 | identifierForNamespace(parameterType->objectType, m_editor)); | ||
235 | if (decl) { | ||||
236 | type = decl->abstractType(); | ||||
237 | } | ||||
238 | } else if (parameterType->arrayType != -1) { | ||||
239 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeArray)); | ||||
240 | } else if (parameterType->boolType != -1) { | ||||
241 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeBoolean)); | ||||
242 | } else if (parameterType->floatType != -1) { | ||||
243 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeFloat)); | ||||
244 | } else if (parameterType->intType != -1) { | ||||
245 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeInt)); | ||||
246 | } else if (parameterType->stringType != -1) { | ||||
247 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeString)); | ||||
248 | } | ||||
249 | | ||||
250 | if (type && parameterType->isNullable != -1) { | ||||
251 | UnsureType::Ptr unsure(new UnsureType()); | ||||
252 | unsure->addType(type->indexed()); | ||||
253 | AbstractType::Ptr nullType = AbstractType::Ptr(new IntegralType(IntegralType::TypeNull)); | ||||
254 | unsure->addType(nullType->indexed()); | ||||
255 | | ||||
256 | type = AbstractType::Ptr(unsure); | ||||
234 | } | 257 | } | ||
235 | } else if (it->element->arrayType != -1) { | | |||
236 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeArray)); | | |||
237 | } else if (it->element->callableType != -1) { | | |||
238 | type = AbstractType::Ptr(new IntegralType(IntegralType::TypeMixed)); | | |||
239 | } else if (it->element->defaultValue) { | 258 | } else if (it->element->defaultValue) { | ||
240 | ExpressionVisitor v(m_editor); | 259 | ExpressionVisitor v(m_editor); | ||
241 | it->element->defaultValue->ducontext = m_currentContext; | 260 | it->element->defaultValue->ducontext = m_currentContext; | ||
Context not available. |