Skip to content

Property wrappers error #259

@Vinestro89

Description

@Vinestro89

Hi !

Following the example given in the documentation:

struct Book: Codable {
    @Element var id: Int
}

I tried to create an instance of a Book:

let book = Book(id: 42)

But I get the following error:

Cannot convert value of type 'Int' to expected argument type 'Element<Int>'

To make it work I have to do:

let book = Book(id: Element(42))

Is there something I'm doing wrong ? Thank you 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions