You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Bar is an inline value class, it is represented as an unboxed integer. When Dalesbred instantiates Foo it doesn't consult Kotlin's metadata and will pass the integer it receives from database directly to the Foo's constructor. If there is a non-positive number in the database, the require-call will not be made and exception will not be thrown.
Kotlin does generate a static constructor-impl -method for Bar that we could call to make sure that init-block will be called, but first we'd need to parse Kotlin metadata to detect the situation.
The text was updated successfully, but these errors were encountered:
Consider the following:
Since Bar is an inline value class, it is represented as an unboxed integer. When Dalesbred instantiates Foo it doesn't consult Kotlin's metadata and will pass the integer it receives from database directly to the Foo's constructor. If there is a non-positive number in the database, the require-call will not be made and exception will not be thrown.
Kotlin does generate a static
constructor-impl
-method for Bar that we could call to make sure that init-block will be called, but first we'd need to parse Kotlin metadata to detect the situation.The text was updated successfully, but these errors were encountered: