Skip to content

allow type functions/algebras for operators #6970

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd
interface In<a> = { __in: a };
interface Ratio<a, b> = { __ratio: [a, b]; }
let value : number & In<MHz>;
let scale : number & Ratio<Px, MHz>;
declare *<a, b>(left: number & In<a>, right: number & Ratio<b, a>): number & In<b>;
let width = value * scale; // <-- expected number & In<Px>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions