Skip to content

Commit 0127f3c

Browse files
muxintangzx
authored andcommitted
查找parent定义时不应该影响当前SearchContext.index
1 parent 872607e commit 0127f3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/tang/intellij/lua/ty/Expressions.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,10 @@ private fun LuaIndexExpr.infer(context: SearchContext): ITy {
323323
//from other class member
324324
val propName = indexExpr.name
325325
if (propName != null) {
326+
// 查找 parent 定义时不应该影响当前index
327+
val saveIdx = context.index
326328
val prefixType = indexExpr.guessParentType(context)
329+
context.index = saveIdx
327330

328331
prefixType.eachTopClass(Processor {
329332
result = result.union(guessFieldType(propName, it, context))

0 commit comments

Comments
 (0)