diff --git a/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeValidator.java b/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeValidator.java index 825bfb07400..3bc89638cb7 100644 --- a/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeValidator.java +++ b/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeValidator.java @@ -142,8 +142,7 @@ protected boolean shouldCheckTopLevelDeclaredOrPrimitiveType( if (type.getKind() != TypeKind.DECLARED && !type.getKind().isPrimitive()) { return true; } - return !TreeUtils.isLocalVariable(tree) - && (!TreeUtils.isExpressionTree(tree) || TreeUtils.isTypeTree(tree)); + return !TreeUtils.isExpressionTree(tree) || TreeUtils.isTypeTree(tree); } /**