Skip to content

Commit

Permalink
Add a test for extends keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Nov 27, 2023
1 parent 0a3beb1 commit 88fce26
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,22 @@ void instanceofOp() {
)
);
}

@ExpectedToFail
@Test
void extendsKeyword() {
rewriteRun(
javaScript(
"""
type PartialPerson = { name?: string; age?: number };
function merge<T extends object, U extends object>(obj1: T, obj2: U): T & U {
return { ...obj1, ...obj2 };
}
const merged = merge({ name: 'John' }, { age: 30 });
"""
)
);
}
}

0 comments on commit 88fce26

Please sign in to comment.