Skip to content

[3.6 regression] Method unions with different generic defaults now error #32506

@Validark

Description

@Validark

TypeScript Version: 3.6.0-dev.20190720

Search Terms: Generic default conflict initializer

Code

interface A {
	bar<T extends number = 1>(): T;
}
interface B {
	bar<T extends number = 2>(): T;
}

declare const foo: A | B;
foo.bar();

Expected behavior: foo.bar() should return 1 | 2 in this case

Actual behavior: error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeWorking as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions