-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Description
Which @angular/* package(s) are the source of the bug?
forms
Is this a regression?
No
Description
In regular object if I have a generic function with T as object union I can access shared properties:
function test<T extends { a: number; b: string } | { a: number; c: boolean }>(value: T) {
console.log(value.a);
}But when using FieldTree I cannot access shared properties:
function test2<T extends { a: number; b: string } | { a: number; c: boolean }>(value: FieldTree<T>) {
console.log(value.a); // errors
}It does work with regular union (no generics):
function test3(value: FieldTree<{ a: number; b: string } | { a: number; c: boolean }>) {
console.log(value.a);
}Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular 21
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Done