Skip to content

Commit 34ec895

Browse files
committed
Add regression test
1 parent 15c6022 commit 34ec895

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,3 +527,30 @@ class Form<T> {
527527
this.childFormFactories[prop](value)
528528
}
529529
}
530+
531+
// Repro from #13787
532+
533+
class SampleClass<P> {
534+
public props: Readonly<P>;
535+
constructor(props: P) {
536+
this.props = Object.freeze(props);
537+
}
538+
}
539+
540+
interface Foo {
541+
foo: string;
542+
}
543+
544+
declare function merge<T, U>(obj1: T, obj2: U): T & U;
545+
546+
class AnotherSampleClass<T> extends SampleClass<T & Foo> {
547+
constructor(props: T) {
548+
const foo: Foo = { foo: "bar" };
549+
super(merge(props, foo));
550+
}
551+
552+
public brokenMethod() {
553+
this.props.foo.concat;
554+
}
555+
}
556+
new AnotherSampleClass({});

0 commit comments

Comments
 (0)