mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Add regression test
This commit is contained in:
parent
15c6022e40
commit
34ec895642
@ -527,3 +527,30 @@ class Form<T> {
|
||||
this.childFormFactories[prop](value)
|
||||
}
|
||||
}
|
||||
|
||||
// Repro from #13787
|
||||
|
||||
class SampleClass<P> {
|
||||
public props: Readonly<P>;
|
||||
constructor(props: P) {
|
||||
this.props = Object.freeze(props);
|
||||
}
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
foo: string;
|
||||
}
|
||||
|
||||
declare function merge<T, U>(obj1: T, obj2: U): T & U;
|
||||
|
||||
class AnotherSampleClass<T> extends SampleClass<T & Foo> {
|
||||
constructor(props: T) {
|
||||
const foo: Foo = { foo: "bar" };
|
||||
super(merge(props, foo));
|
||||
}
|
||||
|
||||
public brokenMethod() {
|
||||
this.props.foo.concat;
|
||||
}
|
||||
}
|
||||
new AnotherSampleClass({});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user