Skip to content

type parameters as constraints feature doesn't compile with --declaration argument #6040

Closed
@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

In the latest typeParametersAsConstraints branch the following:

// test.ts
export function append<a, b extends a>(result: a[], value: b): a[] {
    result.push(value);
    return result;
}

compiles with

node ./built/local/tsc.js --module commonjs test.ts 

but fails with

node ./built/local/tsc.js --module commonjs --declaration test.ts 

saying

test.ts(1,37): error TS4016: Type parameter 'b' of exported function has or is using private name 'a'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions