mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[Feature Request] [stdlib] Make Tuple conform to `CollectionElement` trait again or fix Optional to take in `Movable`

Open martinvuyk opened this issue 9 months ago • 0 comments

Review Mojo's priorities

What is your request?

Implement its __copyinit__ or make Optional accept __moveinit__ as well

What is your motivation for this change?

fn strptime[
    format_str: StringLiteral
](s: String) -> Optional[
    (
        UInt16,
        UInt8,
        UInt8,
        UInt8,
        UInt8,
        UInt8,
        UInt16,
        UInt16,
        UInt16,
    )
]:
    ...

Error: 'Optional' parameter #0 has 'CollectionElement' type, but value has type 'AnyStruct[Tuple[SIMD[uint16, 1], SIMD[uint8, 1], SIMD[uint8, 1], SIMD[uint8, 1], SIMD[uint8, 1], SIMD[uint8, 1], SIMD[uint16, 1], SIMD[uint16, 1], SIMD[uint16, 1]]]'

Any other details?

@ConnorGray this commit changed it

martinvuyk avatar May 17 '24 13:05 martinvuyk