@@ -1961,8 +1961,9 @@ class BinaryBuilder {
19611961 int tag = readByte ();
19621962 switch (tag) {
19631963 case Tag .TypedefType :
1964- return new TypedefType .byReference (
1965- readTypedefReference (), readDartTypeList ());
1964+ int nullabilityIndex = readByte ();
1965+ return new TypedefType .byReference (readTypedefReference (),
1966+ readDartTypeList (), Nullability .values[nullabilityIndex]);
19661967 case Tag .BottomType :
19671968 return const BottomType ();
19681969 case Tag .InvalidType :
@@ -1972,13 +1973,16 @@ class BinaryBuilder {
19721973 case Tag .VoidType :
19731974 return const VoidType ();
19741975 case Tag .InterfaceType :
1975- return new InterfaceType .byReference (
1976- readClassReference (), readDartTypeList ());
1976+ int nullabilityIndex = readByte ();
1977+ return new InterfaceType .byReference (readClassReference (),
1978+ readDartTypeList (), Nullability .values[nullabilityIndex]);
19771979 case Tag .SimpleInterfaceType :
1978- return new InterfaceType .byReference (
1979- readClassReference (), const < DartType > []);
1980+ int nullabilityIndex = readByte ();
1981+ return new InterfaceType .byReference (readClassReference (),
1982+ const < DartType > [], Nullability .values[nullabilityIndex]);
19801983 case Tag .FunctionType :
19811984 int typeParameterStackHeight = typeParameterStack.length;
1985+ int nullabilityIndex = readByte ();
19821986 var typeParameters = readAndPushTypeParameterList ();
19831987 var requiredParameterCount = readUInt ();
19841988 var totalParameterCount = readUInt ();
@@ -1992,15 +1996,20 @@ class BinaryBuilder {
19921996 typeParameters: typeParameters,
19931997 requiredParameterCount: requiredParameterCount,
19941998 namedParameters: named,
1995- typedefType: typedefType);
1999+ typedefType: typedefType,
2000+ nullability: Nullability .values[nullabilityIndex]);
19962001 case Tag .SimpleFunctionType :
2002+ int nullabilityIndex = readByte ();
19972003 var positional = readDartTypeList ();
19982004 var returnType = readDartType ();
1999- return new FunctionType (positional, returnType);
2005+ return new FunctionType (positional, returnType,
2006+ nullability: Nullability .values[nullabilityIndex]);
20002007 case Tag .TypeParameterType :
2008+ int declaredNullabilityIndex = readByte ();
20012009 int index = readUInt ();
20022010 var bound = readDartTypeOption ();
2003- return new TypeParameterType (typeParameterStack[index], bound);
2011+ return new TypeParameterType (typeParameterStack[index], bound,
2012+ Nullability .values[declaredNullabilityIndex]);
20042013 default :
20052014 throw fail ('unexpected dart type tag: $tag ' );
20062015 }
0 commit comments