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
Except if I missed something, this requirement to have the ctor property set after a type is registered into the namespace is not documented.
Ot maybe it is a bug. I understand that the type Foo depends on the type Bar, but it seems very unexpected that the ctor setter actually checks the existence of the other types before proceeding. I assumed it would be deffered until execution (i.e. calls to create or toObject).
If it is a design decision, I'd be curious to understand its rational. Regardless, I think it needs to be documented. I spent a lot of time trying to figure out the issue and I assume I've not been the only one and won't be the last.
The text was updated successfully, but these errors were encountered:
protobuf.js version: 7.4.0
Setting a type
ctor
fails if called before the type is registered into the namespace.Let's consider the following code:
This code fails with a
Error: no such Type or Enum 'Any' in Type Foo
error.Now, let's try registering the
ctor
offooType
after the type was registered into the namespace.This time, the code succeeds.
Except if I missed something, this requirement to have the
ctor
property set after a type is registered into the namespace is not documented.Ot maybe it is a bug. I understand that the type
Foo
depends on the typeBar
, but it seems very unexpected that thector
setter actually checks the existence of the other types before proceeding. I assumed it would be deffered until execution (i.e. calls tocreate
ortoObject
).If it is a design decision, I'd be curious to understand its rational. Regardless, I think it needs to be documented. I spent a lot of time trying to figure out the issue and I assume I've not been the only one and won't be the last.
The text was updated successfully, but these errors were encountered: