Kotlin 编译器报告 Spring 的 TypeDescriptor“没有方法 'equals(Any?): Boolean available”

Ale*_*wer 6 kotlin

对 Spring 的两个实例执行相等性检查时,Kotlin 编译器报告错误TypeDescriptor。例如,

import org.springframework.core.convert.TypeDescriptor

fun foo(a: TypeDescriptor, b: TypeDescriptor) = a == b
Run Code Online (Sandbox Code Playgroud)

无法编译并显示错误消息No method 'equals(Any?): Boolean' availableTypeDescriptor确实覆盖该equals方法,并将==运算符替换为a.equals(b)有效。

我使用的是 Kotlin 版本 1.3.21。