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
Error:
test.fbs:10: 28: error: default value of 0 for field investor_type is not part of enum InvestorType.
According to #5108 there should be an implicit 'NONE' field. Also since the field is optional, I'd think hasInvestorType would return false and investorType would be null by default instead of having to set the default.
We can't specify a value '0' for various reasons, we don't want the possibility. It does work if I declare investor_type:InvestorType = null;, but isn't this what optional means? We don't have to provide =null; for any other types as far as I know, correct me if I'm wrong.
Thanks!
The text was updated successfully, but these errors were encountered:
flatc version 23.5.26
Similar to #5108 but For java. flatc -j test.fbs on contents:
Error:
test.fbs:10: 28: error: default value of
0
for fieldinvestor_type
is not part of enumInvestorType
.According to #5108 there should be an implicit 'NONE' field. Also since the field is optional, I'd think hasInvestorType would return false and investorType would be
null
by default instead of having to set the default.We can't specify a value '0' for various reasons, we don't want the possibility. It does work if I declare
investor_type:InvestorType = null;
, but isn't this what optional means? We don't have to provide=null;
for any other types as far as I know, correct me if I'm wrong.Thanks!
The text was updated successfully, but these errors were encountered: