Skip to content

Commit 20c90fa

Browse files
committed
get rid of getBaseType method
1 parent 26f7675 commit 20c90fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/com/goide/psi/impl/GoPsiImplUtil.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public static GoType getGoTypeInner(@NotNull GoExpression o, @Nullable ResolveSt
314314
if (e == null) return null;
315315
GoType type = e.getGoType(context);
316316
if (type != null && ((GoUnaryExpr)o).getBitAnd() != null) return new LightPointerType(type);
317-
GoType baseType = findBaseType(type);
317+
GoType baseType = type == null || type.getTypeReferenceExpression() == null ? type : type.getUnderlyingType();
318318
if (baseType instanceof GoChannelType && ((GoUnaryExpr)o).getSendChannel() != null) return ((GoChannelType)baseType).getType();
319319
if (baseType instanceof GoPointerType && ((GoUnaryExpr)o).getMul() != null) return ((GoPointerType)baseType).getType();
320320
return baseType;
@@ -429,8 +429,7 @@ else if (o instanceof GoConditionalExpr) {
429429
}
430430

431431
private static GoType findBaseType(@Nullable GoType type) {
432-
GoType baseType = type == null ? null : findBaseTypeFromRef(type.getTypeReferenceExpression());
433-
return baseType instanceof GoSpecType ? ((GoSpecType)baseType).getType() : type;
432+
return type == null || type.getTypeReferenceExpression() == null ? type : type.getUnderlyingType();
434433
}
435434

436435
@Nullable

0 commit comments

Comments
 (0)