Skip to content

Generalize external types #187

@knuton

Description

@knuton

Spaghetti currently supports external interfaces, but not external structs which seems like an arbitrary limitation.

It would be sensible to introduce the notion of an arbitrary external type:

extern ns.foo.Bar

We could allow to use external types in arbitrary positions, e.g.

interface BarSub extends ns.foo.Bar {}

however this might mean that if ns.foo.Bar is not of an appropriate kind in the host environment, the error is only detected after the headers have already been generated and the host language compiler runs.

So we could allow to specify the "kind" of an external type when declaring it, but extend this to struct:

extern interface ns.foo.IBar
extern struct ns.foo.SBar

We could still allow for types of unspecified kinds as

extern type ns.foo.TBar

which can only appear in member or function declarations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions