mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
21 lines
455 B
Swift
21 lines
455 B
Swift
import Foundation
|
|
|
|
@frozen
|
|
public enum Expression<T>: @unchecked Sendable {
|
|
case value(T)
|
|
case link(ExpressionLink<T>)
|
|
}
|
|
|
|
extension Expression: Equatable where T: Equatable {
|
|
public static func ==(lhs: Self, rhs: Self) -> Bool {
|
|
switch (lhs, rhs) {
|
|
case let (.value(lValue), .value(rValue)):
|
|
lValue == rValue
|
|
case let (.link(lValue), .link(rValue)):
|
|
lValue == rValue
|
|
case (.value, _), (.link, _):
|
|
false
|
|
}
|
|
}
|
|
}
|