如何从函数返回未指定的Measurement <T>?

我试图弄清楚如何编写像这样的函数:

func getValue(for measure:TrackedMeasure) -> Measurement<Unit>? {
    switch measure {
    case .currentSpeed:
        return currentSpeed
    // etc
    }
}

I don't want to have to care what the Unit is! Measurements encapsulate their unit, and all I want to do is plug it into something like: Text(reading?.unit.symbol ?? "") at the other end.

func getValue(for measure:TrackedMeasure) -> some Measurement? {} complains "Reference to generic type 'Measurement' requires arguments in <…>"

The suggested fix is func getValue(for measure:TrackedMeasure) -> some Measurement<Unit>? { }, which then complains "An 'opaque' type must specify only 'Any', 'AnyObject', protocols, and/or a base class"

似乎没有用于Measurement的协议,我无法弄清楚如何定义它。

我是否需要重新实施Measurement才能使其正常工作?