Skip to content

Add support for custom type translators #165

@backfromexile

Description

@backfromexile

Tapper does not consider custom type mappers for types.
This makes it impossible to map types that cannot be marked as [TranspilationSource], for example types that have been defined in an external package (also related to #133).

Tapper should fetch custom ITypeTranslators from the transpiled project file.
For this, we probably need another attribute to mark type mappers as mappers for specific types.
Proposal: [TypeTranslator(params Type[] sourceTypes)]

This should work with normal types, and generic types (e.g. Optional<T>) as well as concrete generic types (e.g. Optional<string>).

#164 already adds the foundation for generic type transliation, but support for concrete generic type translation is still missing here.

After this has been implemented, it should be fairly easy to define the TypeTranslator attribute.

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