Skip to content

Access to id of IdentifiedReference potentially undefined #1084

@oliversalzburg

Description

@oliversalzburg

Describe the bug
After upgrading to 4.3.0, access to the id property of an IdentifiedReference is no longer guaranteed to return the id. The field is potentially undefined.

To Reproduce

const foo: IdentifiedReference<User, "id"> = Reference.create<User, "id">(user);
const bar:string = foo.id;

Expected behavior
The above code compiles.

Additional context
This doesn't happen in 4.2.0.

Versions

Dependency Version
node 14
typescript 4.03
mikro-orm 4.3.0
your-driver ?

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions