Skip to content

Add an option to use 'brand type' on value classes and primitives #7

Closed
@aSemy

Description

@aSemy

To help emulate Kotlin's strong typing, use 'brand typing' to specify primitives and value classes. Otherwise TypeScript doesn't discriminate between UInt and Long

Builtin primitives should be handled

type Byte = number & { __kotlin_byte__ : void};

Value classes too

package my.package

@Serializable
@JvmInline
value class UserCount(private val count: UInt)

Something like this...

type UInt = number & { __kotlin_uint__ : void};

type UserCount = UInt & { __my_package__usercount__ : void};

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