未解决的时间运营商

我有以下代码 :

val temp1 = Quat(1f, Vec3(0, 1, 0)).normalize() val temp2 = Quat(.5f, Vec3(1, 0, 0)).normalize() val a = temp1 * Vec3(0, 1, 0) val transformed0 = a * temp1.inverse() // error 

使用此运算符 ,第一个*Quat类中正确解析:

 operator fun times(b: Vec3) = mul(Vec3(), this, b) 

所以aVec3 ,最后一行我们得到了Vec3 * Quat

我想使用的第二个运算符是在此文件的顶层定义的:

 operator fun Vec3.times(b: Quat) = mul(Vec3(), this, b) 

我试图通过键入来执行:

import times

但在建议的times之中,没有一个我正在寻找

有什么问题?

由于在包quat定义了扩展operator fun Vec3.times(b: Quat) ,因此在导入运算符时需要指定该包的名称:

 import quat.times // or import quat.*