Issue #4799 fixed. Generator for KeyCompareWithValue is extracted. (#4802)

* Issue #4799 fixed. Generator for KeyCompareWithValue is extracted.

* format fix
This commit is contained in:
Vladimir Glavnyy
2018-07-05 23:23:40 +07:00
committed by Wouter van Oortmerssen
parent f19803d364
commit 8ea293b988
7 changed files with 77 additions and 96 deletions

View File

@@ -12,7 +12,7 @@ class EnumInNestedNS {
const EnumInNestedNS._(this.value);
factory EnumInNestedNS.fromValue(int value) {
if (value == null) return null;
if (value == null) value = 0;
if (!values.containsKey(value)) {
throw new StateError('Invalid value $value for bit flag enum EnumInNestedNS');
}
@@ -59,7 +59,7 @@ class TableInNestedNS {
final fb.BufferContext _bc;
final int _bcOffset;
int get foo => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, null);
int get foo => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 4, 0);
@override
String toString() {

View File

@@ -21,7 +21,7 @@ class TableInFirstNS {
final int _bcOffset;
namespace_a_namespace_b.TableInNestedNS get fooTable => namespace_a_namespace_b.TableInNestedNS.reader.vTableGet(_bc, _bcOffset, 4, null);
EnumInNestedNS get fooEnum => new EnumInNestedNS.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 6, null));
EnumInNestedNS get fooEnum => new EnumInNestedNS.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 6, 0));
namespace_a_namespace_b.StructInNestedNS get fooStruct => namespace_a_namespace_b.StructInNestedNS.reader.vTableGet(_bc, _bcOffset, 8, null);
@override