@@ -1425,6 +1425,7 @@ abstract class _LinkedReferenceMixin implements idl.LinkedReference {
1425
1425
1426
1426
class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.LinkedUnit {
1427
1427
List <int > _constCycles;
1428
+ List <int > _parametersInheritingCovariant;
1428
1429
List <LinkedReferenceBuilder > _references;
1429
1430
List <EntityRefBuilder > _types;
1430
1431
@@ -1440,6 +1441,19 @@ class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
1440
1441
this ._constCycles = value;
1441
1442
}
1442
1443
1444
+ @override
1445
+ List <int > get parametersInheritingCovariant => _parametersInheritingCovariant ?? = < int > [];
1446
+
1447
+ /**
1448
+ * List of slot ids (referring to [UnlinkedParam.inheritsCovariantSlot] )
1449
+ * corresponding to parameters that inherit `@covariant` behavior from a base
1450
+ * class.
1451
+ */
1452
+ void set parametersInheritingCovariant (List <int > value) {
1453
+ assert (value == null || value.every ((e) => e >= 0 ));
1454
+ this ._parametersInheritingCovariant = value;
1455
+ }
1456
+
1443
1457
@override
1444
1458
List <LinkedReferenceBuilder > get references => _references ?? = < LinkedReferenceBuilder > [];
1445
1459
@@ -1466,8 +1480,9 @@ class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
1466
1480
this ._types = value;
1467
1481
}
1468
1482
1469
- LinkedUnitBuilder ({List <int > constCycles, List <LinkedReferenceBuilder > references, List <EntityRefBuilder > types})
1483
+ LinkedUnitBuilder ({List <int > constCycles, List <int > parametersInheritingCovariant, List < LinkedReferenceBuilder > references, List <EntityRefBuilder > types})
1470
1484
: _constCycles = constCycles,
1485
+ _parametersInheritingCovariant = parametersInheritingCovariant,
1471
1486
_references = references,
1472
1487
_types = types;
1473
1488
@@ -1507,15 +1522,27 @@ class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
1507
1522
signature.addInt (x);
1508
1523
}
1509
1524
}
1525
+ if (this ._parametersInheritingCovariant == null ) {
1526
+ signature.addInt (0 );
1527
+ } else {
1528
+ signature.addInt (this ._parametersInheritingCovariant.length);
1529
+ for (var x in this ._parametersInheritingCovariant) {
1530
+ signature.addInt (x);
1531
+ }
1532
+ }
1510
1533
}
1511
1534
1512
1535
fb.Offset finish (fb.Builder fbBuilder) {
1513
1536
fb.Offset offset_constCycles;
1537
+ fb.Offset offset_parametersInheritingCovariant;
1514
1538
fb.Offset offset_references;
1515
1539
fb.Offset offset_types;
1516
1540
if (! (_constCycles == null || _constCycles.isEmpty)) {
1517
1541
offset_constCycles = fbBuilder.writeListUint32 (_constCycles);
1518
1542
}
1543
+ if (! (_parametersInheritingCovariant == null || _parametersInheritingCovariant.isEmpty)) {
1544
+ offset_parametersInheritingCovariant = fbBuilder.writeListUint32 (_parametersInheritingCovariant);
1545
+ }
1519
1546
if (! (_references == null || _references.isEmpty)) {
1520
1547
offset_references = fbBuilder.writeList (_references.map ((b) => b.finish (fbBuilder)).toList ());
1521
1548
}
@@ -1526,6 +1553,9 @@ class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
1526
1553
if (offset_constCycles != null ) {
1527
1554
fbBuilder.addOffset (2 , offset_constCycles);
1528
1555
}
1556
+ if (offset_parametersInheritingCovariant != null ) {
1557
+ fbBuilder.addOffset (3 , offset_parametersInheritingCovariant);
1558
+ }
1529
1559
if (offset_references != null ) {
1530
1560
fbBuilder.addOffset (0 , offset_references);
1531
1561
}
@@ -1550,6 +1580,7 @@ class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements idl.Linked
1550
1580
_LinkedUnitImpl (this ._bc, this ._bcOffset);
1551
1581
1552
1582
List <int > _constCycles;
1583
+ List <int > _parametersInheritingCovariant;
1553
1584
List <idl.LinkedReference > _references;
1554
1585
List <idl.EntityRef > _types;
1555
1586
@@ -1559,6 +1590,12 @@ class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements idl.Linked
1559
1590
return _constCycles;
1560
1591
}
1561
1592
1593
+ @override
1594
+ List <int > get parametersInheritingCovariant {
1595
+ _parametersInheritingCovariant ?? = const fb.Uint32ListReader ().vTableGet (_bc, _bcOffset, 3 , const < int > []);
1596
+ return _parametersInheritingCovariant;
1597
+ }
1598
+
1562
1599
@override
1563
1600
List <idl.LinkedReference > get references {
1564
1601
_references ?? = const fb.ListReader <idl.LinkedReference >(const _LinkedReferenceReader ()).vTableGet (_bc, _bcOffset, 0 , const < idl.LinkedReference > []);
@@ -1577,6 +1614,7 @@ abstract class _LinkedUnitMixin implements idl.LinkedUnit {
1577
1614
Map <String , Object > toJson () {
1578
1615
Map <String , Object > _result = < String , Object > {};
1579
1616
if (constCycles.isNotEmpty) _result["constCycles" ] = constCycles;
1617
+ if (parametersInheritingCovariant.isNotEmpty) _result["parametersInheritingCovariant" ] = parametersInheritingCovariant;
1580
1618
if (references.isNotEmpty) _result["references" ] = references.map ((_value) => _value.toJson ()).toList ();
1581
1619
if (types.isNotEmpty) _result["types" ] = types.map ((_value) => _value.toJson ()).toList ();
1582
1620
return _result;
@@ -1585,6 +1623,7 @@ abstract class _LinkedUnitMixin implements idl.LinkedUnit {
1585
1623
@override
1586
1624
Map <String , Object > toMap () => {
1587
1625
"constCycles" : constCycles,
1626
+ "parametersInheritingCovariant" : parametersInheritingCovariant,
1588
1627
"references" : references,
1589
1628
"types" : types,
1590
1629
};
@@ -6718,6 +6757,7 @@ class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
6718
6757
CodeRangeBuilder _codeRange;
6719
6758
String _defaultValueCode;
6720
6759
int _inferredTypeSlot;
6760
+ int _inheritsCovariantSlot;
6721
6761
UnlinkedExecutableBuilder _initializer;
6722
6762
bool _isFunctionTyped;
6723
6763
bool _isInitializingFormal;
@@ -6779,6 +6819,22 @@ class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
6779
6819
this ._inferredTypeSlot = value;
6780
6820
}
6781
6821
6822
+ @override
6823
+ int get inheritsCovariantSlot => _inheritsCovariantSlot ?? = 0 ;
6824
+
6825
+ /**
6826
+ * If this is a parameter of an instance method, a nonzero slot id which is
6827
+ * unique within this compilation unit. If this id is found in
6828
+ * [LinkedUnit.parametersInheritingCovariant] , then this parameter inherits
6829
+ * `@covariant` behavior from a base class.
6830
+ *
6831
+ * Otherwise, zero.
6832
+ */
6833
+ void set inheritsCovariantSlot (int value) {
6834
+ assert (value == null || value >= 0 );
6835
+ this ._inheritsCovariantSlot = value;
6836
+ }
6837
+
6782
6838
@override
6783
6839
UnlinkedExecutableBuilder get initializer => _initializer;
6784
6840
@@ -6886,11 +6942,12 @@ class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
6886
6942
this ._visibleOffset = value;
6887
6943
}
6888
6944
6889
- UnlinkedParamBuilder ({List <UnlinkedConstBuilder > annotations, CodeRangeBuilder codeRange, String defaultValueCode, int inferredTypeSlot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, List <UnlinkedParamBuilder > parameters, EntityRefBuilder type, int visibleLength, int visibleOffset})
6945
+ UnlinkedParamBuilder ({List <UnlinkedConstBuilder > annotations, CodeRangeBuilder codeRange, String defaultValueCode, int inferredTypeSlot, int inheritsCovariantSlot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitializingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, List <UnlinkedParamBuilder > parameters, EntityRefBuilder type, int visibleLength, int visibleOffset})
6890
6946
: _annotations = annotations,
6891
6947
_codeRange = codeRange,
6892
6948
_defaultValueCode = defaultValueCode,
6893
6949
_inferredTypeSlot = inferredTypeSlot,
6950
+ _inheritsCovariantSlot = inheritsCovariantSlot,
6894
6951
_initializer = initializer,
6895
6952
_isFunctionTyped = isFunctionTyped,
6896
6953
_isInitializingFormal = isInitializingFormal,
@@ -6946,6 +7003,7 @@ class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
6946
7003
signature.addInt (this ._visibleOffset ?? 0 );
6947
7004
signature.addBool (this ._initializer != null );
6948
7005
this ._initializer? .collectApiSignature (signature);
7006
+ signature.addInt (this ._inheritsCovariantSlot ?? 0 );
6949
7007
}
6950
7008
6951
7009
fb.Offset finish (fb.Builder fbBuilder) {
@@ -6990,6 +7048,9 @@ class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
6990
7048
if (_inferredTypeSlot != null && _inferredTypeSlot != 0 ) {
6991
7049
fbBuilder.addUint32 (2 , _inferredTypeSlot);
6992
7050
}
7051
+ if (_inheritsCovariantSlot != null && _inheritsCovariantSlot != 0 ) {
7052
+ fbBuilder.addUint32 (14 , _inheritsCovariantSlot);
7053
+ }
6993
7054
if (offset_initializer != null ) {
6994
7055
fbBuilder.addOffset (12 , offset_initializer);
6995
7056
}
@@ -7041,6 +7102,7 @@ class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements idl.
7041
7102
idl.CodeRange _codeRange;
7042
7103
String _defaultValueCode;
7043
7104
int _inferredTypeSlot;
7105
+ int _inheritsCovariantSlot;
7044
7106
idl.UnlinkedExecutable _initializer;
7045
7107
bool _isFunctionTyped;
7046
7108
bool _isInitializingFormal;
@@ -7076,6 +7138,12 @@ class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements idl.
7076
7138
return _inferredTypeSlot;
7077
7139
}
7078
7140
7141
+ @override
7142
+ int get inheritsCovariantSlot {
7143
+ _inheritsCovariantSlot ?? = const fb.Uint32Reader ().vTableGet (_bc, _bcOffset, 14 , 0 );
7144
+ return _inheritsCovariantSlot;
7145
+ }
7146
+
7079
7147
@override
7080
7148
idl.UnlinkedExecutable get initializer {
7081
7149
_initializer ?? = const _UnlinkedExecutableReader ().vTableGet (_bc, _bcOffset, 12 , null );
@@ -7145,6 +7213,7 @@ abstract class _UnlinkedParamMixin implements idl.UnlinkedParam {
7145
7213
if (codeRange != null ) _result["codeRange" ] = codeRange.toJson ();
7146
7214
if (defaultValueCode != '' ) _result["defaultValueCode" ] = defaultValueCode;
7147
7215
if (inferredTypeSlot != 0 ) _result["inferredTypeSlot" ] = inferredTypeSlot;
7216
+ if (inheritsCovariantSlot != 0 ) _result["inheritsCovariantSlot" ] = inheritsCovariantSlot;
7148
7217
if (initializer != null ) _result["initializer" ] = initializer.toJson ();
7149
7218
if (isFunctionTyped != false ) _result["isFunctionTyped" ] = isFunctionTyped;
7150
7219
if (isInitializingFormal != false ) _result["isInitializingFormal" ] = isInitializingFormal;
@@ -7164,6 +7233,7 @@ abstract class _UnlinkedParamMixin implements idl.UnlinkedParam {
7164
7233
"codeRange" : codeRange,
7165
7234
"defaultValueCode" : defaultValueCode,
7166
7235
"inferredTypeSlot" : inferredTypeSlot,
7236
+ "inheritsCovariantSlot" : inheritsCovariantSlot,
7167
7237
"initializer" : initializer,
7168
7238
"isFunctionTyped" : isFunctionTyped,
7169
7239
"isInitializingFormal" : isInitializingFormal,
0 commit comments