Documentation Language: Swift

Function

asBag(_:)

Converts a collection to a bag (allowing duplicates).

func asBag(_ collection: any EcoreValue) throws -> [any EcoreValue]

Parameters

collection

The collection to convert

Return Value

A new array representing the bag

Discussion

The asBag operation returns the collection as is, since bags allow duplicates. This is effectively a no-op but provided for OCL compatibility.