Skip to content

maybe add functions for directly working with function or struct types #47

@lenawanel

Description

@lenawanel

Problem

currently it is possible to construct struct types at comptime and before, with the

struct { ... };

likewise with functions.
However there is no way to directly work with the struct Type.
Let's say we wanted to add the field a: i32 to some c :: struct { b: i8 }.
Currently that isn't possble afaik, you could only do something similar with
struct { c: c, a: i32 }.
The same thing can be said for functions

Proposed Solution

add some function addfield :: (ty: mut type, field: type) or addfield :: (ty: type, field: type) -> type
also maybe add some iterator/visitor for struct and function types

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions