Skip to content

Add support for generic data types #4

@dwb357

Description

@dwb357

Given:

@Prototype(kind: .form)
struct Model<Data> where Data: Numeric {
   var value: Data
}

the generated form should read through the Data generic value to the Numeric type to generate:

   LabeledContent(...) {
      TextField("", $model.value, number formatter)
   }

Note that even this is really only partial support due to the nature of swift macros. Since they are processing text, they only have information available at parsing time, ie., they can't determine the actual type of Data, and still must handle Numeric rather abstractly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions