From 3e7c6d283d8e6a07a2cb0e9561598278cc372467 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 30 Apr 2024 11:35:19 -0700 Subject: [PATCH 1/4] Bump analyzer to 6.5.0 --- lib/src/model/accessor.dart | 4 +- lib/src/model/annotation.dart | 4 +- lib/src/model/comment_referable.dart | 2 +- lib/src/model/inheriting_container.dart | 42 ++++++------------- lib/src/model/library.dart | 2 +- lib/src/model/method.dart | 6 +-- lib/src/model/model_element.dart | 2 +- lib/src/model/package_graph.dart | 2 +- pubspec.yaml | 2 +- test/mustachio/aot_compiler_builder_test.dart | 2 +- .../runtime_renderer_builder_test.dart | 4 +- tool/mustachio/codegen_runtime_renderer.dart | 12 +++--- tool/mustachio/utilities.dart | 6 +-- 13 files changed, 33 insertions(+), 57 deletions(-) diff --git a/lib/src/model/accessor.dart b/lib/src/model/accessor.dart index 7e42a5dda1..30d77d2b56 100644 --- a/lib/src/model/accessor.dart +++ b/lib/src/model/accessor.dart @@ -45,9 +45,9 @@ class Accessor extends ModelElement { bool get isSynthetic => element.isSynthetic; - // The [enclosingCombo] where this element was defined. + /// The [enclosingCombo] where this element was defined. late final GetterSetterCombo definingCombo = - getModelForElement(element.variable) as GetterSetterCombo; + getModelForElement(element.variable2!) as GetterSetterCombo; String get _sourceCode { if (!isSynthetic) { diff --git a/lib/src/model/annotation.dart b/lib/src/model/annotation.dart index 3477623cfe..672ba8d338 100644 --- a/lib/src/model/annotation.dart +++ b/lib/src/model/annotation.dart @@ -48,8 +48,8 @@ final class Annotation extends Attribute { late final ElementType _modelType = switch (_annotation.element) { ConstructorElement(:var returnType) => _packageGraph.getTypeFor(returnType, _library), - PropertyAccessorElement(:var variable) => - (_packageGraph.getModelForElement(variable) as GetterSetterCombo) + PropertyAccessorElement(:var variable2?) => + (_packageGraph.getModelForElement(variable2) as GetterSetterCombo) .modelType, _ => throw StateError( 'non-callable element used as annotation?: ${_annotation.element}') diff --git a/lib/src/model/comment_referable.dart b/lib/src/model/comment_referable.dart index b2897658af..1a5c276e07 100644 --- a/lib/src/model/comment_referable.dart +++ b/lib/src/model/comment_referable.dart @@ -105,7 +105,7 @@ mixin CommentReferable implements Nameable { if (resultElement == null) return null; ModelElement result; if (resultElement is PropertyAccessorElement) { - final variable = resultElement.variable; + final variable = resultElement.variable2!; if (variable.isSynthetic) { result = packageGraph.getModelForElement(resultElement); } else { diff --git a/lib/src/model/inheriting_container.dart b/lib/src/model/inheriting_container.dart index 17c49bf9a9..30538f314d 100644 --- a/lib/src/model/inheriting_container.dart +++ b/lib/src/model/inheriting_container.dart @@ -19,13 +19,9 @@ import 'package:meta/meta.dart'; /// Note that [Constructor]s are not considered to be modifiers so a /// [hasModifiers] override is not necessary for this mixin. mixin Constructable implements InheritingContainer { - late final List constructors = - // TODO(srawlins): Remove this and deal with the follow-on effects, when - // `.augmented` becomes non-nullable. - // ignore: invalid_null_aware_operator - (element.augmented?.constructors ?? element.constructors) - .map((e) => getModelFor(e, library) as Constructor) - .toList(growable: false); + late final List constructors = element.augmented.constructors + .map((e) => getModelFor(e, library) as Constructor) + .toList(growable: false); @override late final List publicConstructorsSorted = @@ -157,11 +153,11 @@ abstract class InheritingContainer extends Container { // The mapping of all of the inherited element names to their _concrete_ // implementation element. var concreteInheritanceMap = packageGraph.inheritanceManager - .getInheritedConcreteMap2(element.augmentedDeclarationOrSelf); + .getInheritedConcreteMap2(element.augmented.declaration); // The mapping of all inherited element names to the nearest inherited // element that they resolve to. var inheritanceMap = packageGraph.inheritanceManager - .getInheritedMap2(element.augmentedDeclarationOrSelf); + .getInheritedMap2(element.augmented.declaration); var inheritanceChainElements = inheritanceChain.map((c) => c.element).toList(growable: false); @@ -259,13 +255,9 @@ abstract class InheritingContainer extends Container { }(); @override - late final List declaredMethods = - // TODO(srawlins): Remove this and deal with the follow-on effects, when - // `.augmented` becomes non-nullable. - // ignore: invalid_null_aware_operator - (element.augmented?.methods ?? element.methods) - .map((e) => getModelFor(e, library) as Method) - .toList(growable: false); + late final List declaredMethods = element.augmented.methods + .map((e) => getModelFor(e, library) as Method) + .toList(growable: false); @override late final List typeParameters = element.typeParameters @@ -538,9 +530,9 @@ abstract class InheritingContainer extends Container { // Pick an appropriate [FieldElement] to represent this element. // Only hard when dealing with a synthetic [Field]. if (getter != null && setter == null) { - field = getterElement!.variable as FieldElement; + field = getterElement!.variable2 as FieldElement; } else if (getter == null && setter != null) { - field = setterElement!.variable as FieldElement; + field = setterElement!.variable2 as FieldElement; } else { // In this case: `getter != null && setter != null`. getter!; @@ -553,9 +545,9 @@ abstract class InheritingContainer extends Container { if (setterEnclosingElement is Class && setterEnclosingElement._isInheritingFrom( getter.enclosingElement as InheritingContainer)) { - field = setterElement!.variable as FieldElement; + field = setterElement!.variable2 as FieldElement; } else { - field = getterElement!.variable as FieldElement; + field = getterElement!.variable2 as FieldElement; } } } @@ -601,16 +593,6 @@ mixin MixedInTypes on InheritingContainer { mixedInTypes.wherePublic; } -extension on InterfaceElement { - /// This element's augmented declaration, or, if there is none, then just this - /// element itself. - InterfaceElement get augmentedDeclarationOrSelf => - // TODO(srawlins): Remove this and deal with the follow-on effects, when - // `.augmented` becomes non-nullable. - // ignore: invalid_null_aware_operator - augmented?.declaration ?? this; -} - extension on InterfaceElement { bool get isDartCoreObject => name == 'Object' && library.name == 'dart.core'; } diff --git a/lib/src/model/library.dart b/lib/src/model/library.dart index ed46923592..122e0eedbd 100644 --- a/lib/src/model/library.dart +++ b/lib/src/model/library.dart @@ -340,7 +340,7 @@ class Library extends ModelElement ..._exportedAndLocalElements.whereType(), ..._exportedAndLocalElements .whereType() - .map((a) => a.variable as TopLevelVariableElement) + .map((a) => a.variable2! as TopLevelVariableElement) }; var variables = []; for (var element in elements) { diff --git a/lib/src/model/method.dart b/lib/src/model/method.dart index c9e58c7378..fd1c530f13 100644 --- a/lib/src/model/method.dart +++ b/lib/src/model/method.dart @@ -112,11 +112,7 @@ class Method extends ModelElement return null; } var parent = element.enclosingElement as InterfaceElement; - // TODO(srawlins): Remove this and deal with the follow-on effects, when - // `.augmented` becomes non-nullable. - // ignore: invalid_null_aware_operator - var parentDeclaration = parent.augmented?.declaration ?? parent; - for (var t in parentDeclaration.allSupertypes) { + for (var t in parent.augmented.declaration.allSupertypes) { Element? e = t.getMethod(element.name); if (e != null) { assert( diff --git a/lib/src/model/model_element.dart b/lib/src/model/model_element.dart index 7c55569568..8d495ea101 100644 --- a/lib/src/model/model_element.dart +++ b/lib/src/model/model_element.dart @@ -502,7 +502,7 @@ abstract class ModelElement var lookup = l.element.exportNamespace.definedNames[topLevelElement.name!]; return switch (lookup) { - PropertyAccessorElement() => topLevelElement == lookup.variable, + PropertyAccessorElement() => topLevelElement == lookup.variable2, _ => topLevelElement == lookup, }; }).toList(growable: true); diff --git a/lib/src/model/package_graph.dart b/lib/src/model/package_graph.dart index a33727b704..1f89bd6ff5 100644 --- a/lib/src/model/package_graph.dart +++ b/lib/src/model/package_graph.dart @@ -706,7 +706,7 @@ class PackageGraph with CommentReferable, Nameable { _canonicalLibraryFor[e] = null; var searchElement = switch (e) { - PropertyAccessorElement() => e.variable, + PropertyAccessorElement() => e.variable2, GenericFunctionTypeElement() => e.enclosingElement, _ => e, }; diff --git a/pubspec.yaml b/pubspec.yaml index bf6fcb87b1..4f8b7cfe49 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: ^3.2.0 dependencies: - analyzer: ^6.4.1 + analyzer: ^6.5.0 args: ^2.4.1 collection: ^1.17.0 crypto: ^3.0.3 diff --git a/test/mustachio/aot_compiler_builder_test.dart b/test/mustachio/aot_compiler_builder_test.dart index 878230ad59..0d246e4c36 100644 --- a/test/mustachio/aot_compiler_builder_test.dart +++ b/test/mustachio/aot_compiler_builder_test.dart @@ -109,7 +109,7 @@ class Baz {} var fooRenderFunction = renderersLibrary.getTopLevelFunction('renderFoo')!; expect(fooRenderFunction.typeParameters, hasLength(1)); var fBound = fooRenderFunction.typeParameters.single.bound!; - expect(fBound.getDisplayString(withNullability: false), equals('num')); + expect(fBound.getDisplayString(), equals('num')); }); test('deduplicates partials which share context type LUB', () async { diff --git a/test/mustachio/runtime_renderer_builder_test.dart b/test/mustachio/runtime_renderer_builder_test.dart index 37819ad3da..d28a1a3fc0 100644 --- a/test/mustachio/runtime_renderer_builder_test.dart +++ b/test/mustachio/runtime_renderer_builder_test.dart @@ -234,12 +234,12 @@ class Baz {} var fooRenderFunction = renderersLibrary.getTopLevelFunction('renderFoo')!; expect(fooRenderFunction.typeParameters, hasLength(1)); var fBound = fooRenderFunction.typeParameters.single.bound!; - expect(fBound.getDisplayString(withNullability: false), equals('num')); + expect(fBound.getDisplayString(), equals('num')); var fooRendererClass = renderersLibrary.getClass('_Renderer_Foo')!; expect(fooRendererClass.typeParameters, hasLength(1)); var cBound = fooRenderFunction.typeParameters.single.bound!; - expect(cBound.getDisplayString(withNullability: false), equals('num')); + expect(cBound.getDisplayString(), equals('num')); }); group('does not generate a renderer', () { diff --git a/tool/mustachio/codegen_runtime_renderer.dart b/tool/mustachio/codegen_runtime_renderer.dart index 162d11ea3f..10c48f7329 100644 --- a/tool/mustachio/codegen_runtime_renderer.dart +++ b/tool/mustachio/codegen_runtime_renderer.dart @@ -423,8 +423,7 @@ class ${renderer._rendererClassName}${renderer._typeParametersString} if (superclassRendererName != null) { var superMapName = '$superclassRendererName.propertyMap'; var generics = asGenerics([ - ...supertype.typeArguments - .map((e) => e.getDisplayString(withNullability: false)), + ...supertype.typeArguments.map((e) => e.getDisplayString()), _contextTypeVariable ]); _buffer.writeln(' ...$superMapName$generics(),'); @@ -441,8 +440,7 @@ class ${renderer._rendererClassName}${renderer._typeParametersString} if (mixinRendererName != null) { var mixinMapName = '$mixinRendererName.propertyMap'; var generics = asGenerics([ - ...mixin.typeArguments - .map((e) => e.getDisplayString(withNullability: false)), + ...mixin.typeArguments.map((e) => e.getDisplayString()), _contextTypeVariable ]); _buffer.writeln(' ...$mixinMapName$generics(),'); @@ -476,7 +474,7 @@ class ${renderer._rendererClassName}${renderer._typeParametersString} .writeln('getValue: ($_contextTypeVariable c) => c.${property.name},'); var getterName = property.name; - var getterTypeString = getterType.getDisplayString(withNullability: false); + var getterTypeString = getterType.getDisplayString(); // Only add a `getProperties` function, which returns the property map for // [getterType], if [getterType] is a renderable type. if (_typeToRendererClassName.containsKey(getterType.element)) { @@ -676,7 +674,7 @@ class _RendererInfo { _contextClass.typeParametersStringWith(extra); String _renderSingleType(DartType tp) { - var displayString = tp.getDisplayString(withNullability: false); + var displayString = tp.getDisplayString(); var nullabilitySuffix = tp.nullabilitySuffix == NullabilitySuffix.question ? '?' : ''; return '$displayString$nullabilitySuffix'; @@ -710,6 +708,7 @@ extension on InterfaceElement { extension on PropertyAccessorElement { // Whether this property should be omitted from the runtime renderer code. bool get shouldBeOmitted { + var variable = variable2; return isPrivate || isStatic || isSetter || @@ -717,6 +716,7 @@ extension on PropertyAccessorElement { hasProtected || hasVisibleForOverriding || hasVisibleForTesting || + variable == null || variable.hasInternal || variable.hasProtected || variable.hasVisibleForOverriding || diff --git a/tool/mustachio/utilities.dart b/tool/mustachio/utilities.dart index 89418ffd72..8852e035d6 100644 --- a/tool/mustachio/utilities.dart +++ b/tool/mustachio/utilities.dart @@ -8,8 +8,7 @@ extension InterfaceElementExtension on InterfaceElement { /// The type parameters, if any, as a String, including bounds and the angled /// brackets, otherwise a blank String. String get typeParametersString { - return asGenerics(typeParameters - .map((tp) => tp.getDisplayString(withNullability: false))); + return asGenerics(typeParameters.map((tp) => tp.getDisplayString())); } /// The type variables, if any, as a String, including the angled brackets, @@ -22,8 +21,7 @@ extension InterfaceElementExtension on InterfaceElement { /// generics. String typeParametersStringWith(String extra) { return asGenerics([ - ...typeParameters - .map((tp) => tp.getDisplayString(withNullability: false)), + ...typeParameters.map((tp) => tp.getDisplayString()), extra, ]); } From 25e238e59132f3eca7164d7fffea373ab3ff3f8d Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 30 Apr 2024 11:42:10 -0700 Subject: [PATCH 2/4] regenerate --- .../templates.runtime_renderers.dart | 219 +++++++++--------- test/mustachio/foo.runtime_renderers.dart | 26 +-- 2 files changed, 126 insertions(+), 119 deletions(-) diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index 0fe537c048..a5d1a15207 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -67,7 +67,7 @@ class _Renderer_Accessor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -83,7 +83,7 @@ class _Renderer_Accessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -238,7 +238,7 @@ class _Renderer_Accessor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -315,7 +315,7 @@ class _Renderer_Accessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ExecutableMember'), + c, remainingNames, 'ExecutableMember?'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -750,7 +750,7 @@ class _Renderer_Categorization extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'List'), + c, remainingNames, 'List?'), isNullValue: (CT_ c) => c.categoryNames == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -796,7 +796,7 @@ class _Renderer_Categorization extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'List'), + c, remainingNames, 'List?'), isNullValue: (CT_ c) => c.subCategoryNames == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -853,7 +853,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -875,7 +875,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -975,7 +975,7 @@ class _Renderer_Category extends RendererBase { getValue: (CT_ c) => c.documentationFile, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'File'), + self.renderSimpleVariable(c, remainingNames, 'File?'), isNullValue: (CT_ c) => c.documentationFile == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -1014,7 +1014,7 @@ class _Renderer_Category extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element'), + self.renderSimpleVariable(c, remainingNames, 'Element?'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -1174,7 +1174,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -1825,7 +1825,7 @@ class _Renderer_CommentReferable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -1846,7 +1846,7 @@ class _Renderer_CommentReferable extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library, + self.getValue(c) as Library?, nextProperty, [...remainingNames.skip(1)]); }, @@ -1875,7 +1875,7 @@ class _Renderer_CommentReferable extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Iterable'), + c, remainingNames, 'Iterable?'), isNullValue: (CT_ c) => c.referenceGrandparentOverrides == null, renderValue: (CT_ c, RendererBase r, @@ -1925,7 +1925,7 @@ class _Renderer_CommentReferable extends RendererBase { getValue: (CT_ c) => c.scope, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Scope'), + self.renderSimpleVariable(c, remainingNames, 'Scope?'), isNullValue: (CT_ c) => c.scope == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -2053,7 +2053,7 @@ class _Renderer_Constructor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -2069,7 +2069,7 @@ class _Renderer_Constructor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -2331,7 +2331,7 @@ class _Renderer_Constructor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -2668,7 +2668,7 @@ class _Renderer_Container extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Set'), + c, remainingNames, 'Set'), renderIterable: (CT_ c, RendererBase r, List ast, StringSink sink) { return c.allElements.map((e) => renderSimple( @@ -3147,7 +3147,7 @@ class _Renderer_Container extends RendererBase { getValue: (CT_ c) => c.scope, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Scope'), + self.renderSimpleVariable(c, remainingNames, 'Scope?'), isNullValue: (CT_ c) => c.scope == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -3263,7 +3263,7 @@ class _Renderer_ContainerAccessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -3319,7 +3319,7 @@ class _Renderer_ContainerAccessor extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor, + self.getValue(c) as ContainerAccessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3378,7 +3378,7 @@ class _Renderer_ContainerMember extends RendererBase { var nextProperty = _Renderer_Container.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Container, + self.getValue(c) as Container?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3576,7 +3576,7 @@ class _Renderer_DefinedElementType extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Iterable'), + c, remainingNames, 'Iterable?'), isNullValue: (CT_ c) => c.referenceGrandparentOverrides == null, renderValue: (CT_ c, RendererBase r, @@ -3655,7 +3655,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3677,7 +3677,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3713,7 +3713,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3764,7 +3764,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -3992,7 +3992,7 @@ class _Renderer_DocumentationComment var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -4049,7 +4049,7 @@ class _Renderer_DocumentationComment var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -5712,7 +5712,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -5857,7 +5857,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor, + self.getValue(c) as ContainerAccessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -5879,7 +5879,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -5954,7 +5954,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_Inheritable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Inheritable, + self.getValue(c) as Inheritable?, nextProperty, [...remainingNames.skip(1)]); }, @@ -5976,7 +5976,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor, + self.getValue(c) as ContainerAccessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6333,7 +6333,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6347,7 +6347,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Expression'), + c, remainingNames, 'Expression?'), isNullValue: (CT_ c) => c.constantInitializer == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6515,7 +6515,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor, + self.getValue(c) as Accessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6656,7 +6656,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6762,7 +6762,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor, + self.getValue(c) as Accessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6813,7 +6813,7 @@ class _Renderer_HasNoPage extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6835,7 +6835,7 @@ class _Renderer_HasNoPage extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6901,7 +6901,7 @@ class _Renderer_Indexable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -6927,7 +6927,7 @@ class _Renderer_Indexable extends RendererBase { getValue: (CT_ c) => c.overriddenDepth, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'int'), + self.renderSimpleVariable(c, remainingNames, 'int?'), isNullValue: (CT_ c) => c.overriddenDepth == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6981,7 +6981,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library, + self.getValue(c) as Library?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7003,7 +7003,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement, + self.getValue(c) as ModelElement?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7072,7 +7072,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_Inheritable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Inheritable, + self.getValue(c) as Inheritable?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7588,7 +7588,7 @@ class _Renderer_InheritingContainer extends RendererBase { _Renderer_DefinedElementType.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as DefinedElementType, + self.getValue(c) as DefinedElementType?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7852,7 +7852,7 @@ class _Renderer_LanguageFeature extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7896,7 +7896,7 @@ class _Renderer_LanguageFeature extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -7972,7 +7972,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -8045,7 +8045,7 @@ class _Renderer_Library extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -8174,7 +8174,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement, + self.getValue(c) as ModelElement?, nextProperty, [...remainingNames.skip(1)]); }, @@ -8303,7 +8303,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -8441,7 +8441,7 @@ class _Renderer_Library extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'PackageMeta'), + c, remainingNames, 'PackageMeta?'), isNullValue: (CT_ c) => c.packageMeta == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -8908,7 +8908,7 @@ class _Renderer_Locatable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -9019,7 +9019,7 @@ class _Renderer_MarkdownFileDocumentation getValue: (CT_ c) => c.documentationFile, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'File'), + self.renderSimpleVariable(c, remainingNames, 'File?'), isNullValue: (CT_ c) => c.documentationFile == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9178,7 +9178,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -9194,7 +9194,7 @@ class _Renderer_Method extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9294,7 +9294,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -9371,7 +9371,7 @@ class _Renderer_Method extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ExecutableMember'), + c, remainingNames, 'ExecutableMember?'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9391,7 +9391,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_Method.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Method, + self.getValue(c) as Method?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10099,7 +10099,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library, + self.getValue(c) as Library?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10121,7 +10121,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement, + self.getValue(c) as ModelElement?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10138,7 +10138,7 @@ class _Renderer_ModelElement extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -10203,7 +10203,7 @@ class _Renderer_ModelElement extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Iterable'), + c, remainingNames, 'Iterable'), renderIterable: (CT_ c, RendererBase r, List ast, StringSink sink) { return c.displayedCategories.map((e) => @@ -10255,7 +10255,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement, + self.getValue(c) as ModelElement?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10409,7 +10409,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10643,7 +10643,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -10681,7 +10681,8 @@ class _Renderer_ModelElement extends RendererBase { getValue: (CT_ c) => c.modelNode, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'ModelNode'), + self.renderSimpleVariable( + c, remainingNames, 'ModelNode?'), isNullValue: (CT_ c) => c.modelNode == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -10736,7 +10737,7 @@ class _Renderer_ModelElement extends RendererBase { getValue: (CT_ c) => c.originalMember, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Member'), + self.renderSimpleVariable(c, remainingNames, 'Member?'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -11014,7 +11015,7 @@ class _Renderer_ModelFunctionTyped extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -11094,7 +11095,7 @@ class _Renderer_ModelFunctionTyped extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -11563,7 +11564,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -11619,7 +11620,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -11713,7 +11714,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -11789,7 +11790,7 @@ class _Renderer_Package extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element'), + self.renderSimpleVariable(c, remainingNames, 'Element?'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -12036,7 +12037,7 @@ class _Renderer_Package extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Map'), + c, remainingNames, 'Map'), isNullValue: (CT_ c) => false, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -12202,7 +12203,7 @@ class _Renderer_Package extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Map>'), + c, remainingNames, 'Map>'), isNullValue: (CT_ c) => false, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -12524,7 +12525,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -12560,7 +12561,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement, + self.getValue(c) as ModelElement?, nextProperty, [...remainingNames.skip(1)]); }, @@ -12602,7 +12603,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -12707,7 +12708,7 @@ class _Renderer_Parameter extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ParameterMember'), + c, remainingNames, 'ParameterMember?'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13113,7 +13114,7 @@ class _Renderer_SourceCode extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation'), + c, remainingNames, 'CharacterLocation?'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13126,7 +13127,7 @@ class _Renderer_SourceCode extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element'), + self.renderSimpleVariable(c, remainingNames, 'Element?'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13152,7 +13153,7 @@ class _Renderer_SourceCode extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library, + self.getValue(c) as Library?, nextProperty, [...remainingNames.skip(1)]); }, @@ -13167,7 +13168,8 @@ class _Renderer_SourceCode extends RendererBase { getValue: (CT_ c) => c.modelNode, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'ModelNode'), + self.renderSimpleVariable( + c, remainingNames, 'ModelNode?'), isNullValue: (CT_ c) => c.modelNode == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13325,7 +13327,7 @@ class _Renderer_TemplateData var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -13347,7 +13349,7 @@ class _Renderer_TemplateData var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -13539,7 +13541,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -13692,7 +13694,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_Documentable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Documentable, + self.getValue(c) as Documentable?, nextProperty, [...remainingNames.skip(1)]); }, @@ -13737,7 +13739,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14555,7 +14557,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14657,7 +14659,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor, + self.getValue(c) as Accessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14679,7 +14681,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14754,7 +14756,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor, + self.getValue(c) as Accessor?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14853,7 +14855,7 @@ class _Renderer_TypeParameter extends RendererBase { var nextProperty = _Renderer_ElementType.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ElementType, + self.getValue(c) as ElementType?, nextProperty, [...remainingNames.skip(1)]); }, @@ -14919,7 +14921,7 @@ class _Renderer_TypeParameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -15264,7 +15266,7 @@ class _Renderer_Typedef extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -15366,7 +15368,7 @@ class _Renderer_Typedef extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String, + self.getValue(c) as String?, nextProperty, [...remainingNames.skip(1)]); }, @@ -15709,7 +15711,7 @@ class _Renderer_Warnable extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element'), + self.renderSimpleVariable(c, remainingNames, 'Element?'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -15762,7 +15764,6 @@ const _invisibleGetters = { 'isDartCoreObject', 'isExhaustive', 'isFinal', - 'isInline', 'isInterface', 'isMixinApplication', 'isMixinClass', @@ -15926,6 +15927,7 @@ const _invisibleGetters = { 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', + 'hasDoNotSubmit', 'hasFactory', 'hasImmutable', 'hasInternal', @@ -15933,6 +15935,7 @@ const _invisibleGetters = { 'hasIsTestGroup', 'hasJS', 'hasLiteral', + 'hasMustBeConst', 'hasMustBeOverridden', 'hasMustCallSuper', 'hasNonVirtual', @@ -15984,6 +15987,7 @@ const _invisibleGetters = { 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', + 'hasDoNotSubmit', 'hasFactory', 'hasImmutable', 'hasImplicitReturnType', @@ -15992,6 +15996,7 @@ const _invisibleGetters = { 'hasIsTestGroup', 'hasJS', 'hasLiteral', + 'hasMustBeConst', 'hasMustBeOverridden', 'hasMustCallSuper', 'hasNonVirtual', @@ -16015,7 +16020,6 @@ const _invisibleGetters = { 'isExtensionTypeMember', 'isExternal', 'isGenerator', - 'isLegacy', 'isOperator', 'isPrivate', 'isPublic', @@ -16247,6 +16251,7 @@ const _invisibleGetters = { 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', + 'hasDoNotSubmit', 'hasFactory', 'hasImmutable', 'hasInternal', @@ -16254,6 +16259,7 @@ const _invisibleGetters = { 'hasIsTestGroup', 'hasJS', 'hasLiteral', + 'hasMustBeConst', 'hasMustBeOverridden', 'hasMustCallSuper', 'hasNonVirtual', @@ -16271,7 +16277,6 @@ const _invisibleGetters = { 'hasVisibleOutsideTemplate', 'hashCode', 'id', - 'isLegacy', 'isPrivate', 'isPublic', 'isSynthetic', @@ -16399,6 +16404,7 @@ const _invisibleGetters = { 'hasDefaultValue', 'hasDeprecated', 'hasDoNotStore', + 'hasDoNotSubmit', 'hasFactory', 'hasImmutable', 'hasImplicitType', @@ -16407,6 +16413,7 @@ const _invisibleGetters = { 'hasIsTestGroup', 'hasJS', 'hasLiteral', + 'hasMustBeConst', 'hasMustBeOverridden', 'hasMustCallSuper', 'hasNonVirtual', @@ -16430,7 +16437,6 @@ const _invisibleGetters = { 'isFinal', 'isInitializingFormal', 'isLate', - 'isLegacy', 'isPrivate', 'isPublic', 'isStatic', @@ -16467,7 +16473,8 @@ const _invisibleGetters = { 'isGetter', 'isSetter', 'runtimeType', - 'variable' + 'variable', + 'variable2' }, 'Scope': {'hashCode', 'runtimeType'}, 'TemplateOptions': { diff --git a/test/mustachio/foo.runtime_renderers.dart b/test/mustachio/foo.runtime_renderers.dart index 204b97b51f..661c767c1f 100644 --- a/test/mustachio/foo.runtime_renderers.dart +++ b/test/mustachio/foo.runtime_renderers.dart @@ -50,7 +50,7 @@ class Renderer_Bar extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Baz.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Baz, + return nextProperty.renderVariable(self.getValue(c) as Baz?, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.baz == null, @@ -69,7 +69,7 @@ class Renderer_Bar extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Foo.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Foo, + return nextProperty.renderVariable(self.getValue(c) as Foo?, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.foo == null, @@ -82,14 +82,14 @@ class Renderer_Bar extends RendererBase { getValue: (CT_ c) => c.l1, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'bool'), + self.renderSimpleVariable(c, remainingNames, 'bool?'), getBool: (CT_ c) => c.l1 == true, ), 's2': Property( getValue: (CT_ c) => c.s2, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String'), + self.renderSimpleVariable(c, remainingNames, 'String?'), isNullValue: (CT_ c) => c.s2 == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -143,7 +143,7 @@ class Renderer_Baz extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Bar.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Bar, + return nextProperty.renderVariable(self.getValue(c) as Bar?, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.bar == null, @@ -205,7 +205,7 @@ class Renderer_Foo extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Baz.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Baz, + return nextProperty.renderVariable(self.getValue(c) as Baz?, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.baz == null, @@ -230,7 +230,7 @@ class Renderer_Foo extends RendererBase { getValue: (CT_ c) => c.length, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'int'), + self.renderSimpleVariable(c, remainingNames, 'int?'), isNullValue: (CT_ c) => c.length == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -249,7 +249,7 @@ class Renderer_Foo extends RendererBase { var nextProperty = Renderer_Property1.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property1, + self.getValue(c) as Property1?, nextProperty, [...remainingNames.skip(1)]); }, @@ -263,7 +263,7 @@ class Renderer_Foo extends RendererBase { getValue: (CT_ c) => c.s1, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String'), + self.renderSimpleVariable(c, remainingNames, 'String?'), isNullValue: (CT_ c) => c.s1 == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -350,7 +350,7 @@ class Renderer_Mixin1 extends RendererBase { var nextProperty = Renderer_Property3.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property3, + self.getValue(c) as Property3?, nextProperty, [...remainingNames.skip(1)]); }, @@ -435,7 +435,7 @@ class Renderer_Property1 extends RendererBase { var nextProperty = Renderer_Property2.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property2, + self.getValue(c) as Property2?, nextProperty, [...remainingNames.skip(1)]); }, @@ -480,7 +480,7 @@ class Renderer_Property2 extends RendererBase { getValue: (CT_ c) => c.s, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String'), + self.renderSimpleVariable(c, remainingNames, 'String?'), isNullValue: (CT_ c) => c.s == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -522,7 +522,7 @@ class Renderer_Property3 extends RendererBase { getValue: (CT_ c) => c.s, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String'), + self.renderSimpleVariable(c, remainingNames, 'String?'), isNullValue: (CT_ c) => c.s == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { From 7a8083745363bba800a16c898fc1bb5519d5b2be Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 30 Apr 2024 14:13:07 -0700 Subject: [PATCH 3/4] Regenerate --- .../templates.runtime_renderers.dart | 196 +++++++++--------- lib/src/mustachio/renderer_base.dart | 12 +- test/mustachio/foo.runtime_renderers.dart | 26 +-- tool/mustachio/codegen_runtime_renderer.dart | 10 +- 4 files changed, 123 insertions(+), 121 deletions(-) diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index a5d1a15207..7e226401d1 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -67,7 +67,7 @@ class _Renderer_Accessor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -83,7 +83,7 @@ class _Renderer_Accessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -238,7 +238,7 @@ class _Renderer_Accessor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -315,7 +315,7 @@ class _Renderer_Accessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ExecutableMember?'), + c, remainingNames, 'ExecutableMember'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -750,7 +750,7 @@ class _Renderer_Categorization extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'List?'), + c, remainingNames, 'List'), isNullValue: (CT_ c) => c.categoryNames == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -796,7 +796,7 @@ class _Renderer_Categorization extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'List?'), + c, remainingNames, 'List'), isNullValue: (CT_ c) => c.subCategoryNames == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -853,7 +853,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -875,7 +875,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -975,7 +975,7 @@ class _Renderer_Category extends RendererBase { getValue: (CT_ c) => c.documentationFile, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'File?'), + self.renderSimpleVariable(c, remainingNames, 'File'), isNullValue: (CT_ c) => c.documentationFile == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -1014,7 +1014,7 @@ class _Renderer_Category extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element?'), + self.renderSimpleVariable(c, remainingNames, 'Element'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -1174,7 +1174,7 @@ class _Renderer_Category extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -1825,7 +1825,7 @@ class _Renderer_CommentReferable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -1846,7 +1846,7 @@ class _Renderer_CommentReferable extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library?, + self.getValue(c) as Library, nextProperty, [...remainingNames.skip(1)]); }, @@ -1875,7 +1875,7 @@ class _Renderer_CommentReferable extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Iterable?'), + c, remainingNames, 'Iterable'), isNullValue: (CT_ c) => c.referenceGrandparentOverrides == null, renderValue: (CT_ c, RendererBase r, @@ -1925,7 +1925,7 @@ class _Renderer_CommentReferable extends RendererBase { getValue: (CT_ c) => c.scope, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Scope?'), + self.renderSimpleVariable(c, remainingNames, 'Scope'), isNullValue: (CT_ c) => c.scope == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -2053,7 +2053,7 @@ class _Renderer_Constructor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -2069,7 +2069,7 @@ class _Renderer_Constructor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -2331,7 +2331,7 @@ class _Renderer_Constructor extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -3147,7 +3147,7 @@ class _Renderer_Container extends RendererBase { getValue: (CT_ c) => c.scope, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Scope?'), + self.renderSimpleVariable(c, remainingNames, 'Scope'), isNullValue: (CT_ c) => c.scope == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -3263,7 +3263,7 @@ class _Renderer_ContainerAccessor extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -3319,7 +3319,7 @@ class _Renderer_ContainerAccessor extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor?, + self.getValue(c) as ContainerAccessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -3378,7 +3378,7 @@ class _Renderer_ContainerMember extends RendererBase { var nextProperty = _Renderer_Container.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Container?, + self.getValue(c) as Container, nextProperty, [...remainingNames.skip(1)]); }, @@ -3576,7 +3576,7 @@ class _Renderer_DefinedElementType extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Iterable?'), + c, remainingNames, 'Iterable'), isNullValue: (CT_ c) => c.referenceGrandparentOverrides == null, renderValue: (CT_ c, RendererBase r, @@ -3655,7 +3655,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -3677,7 +3677,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -3713,7 +3713,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -3764,7 +3764,7 @@ class _Renderer_Documentable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -3992,7 +3992,7 @@ class _Renderer_DocumentationComment var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -4049,7 +4049,7 @@ class _Renderer_DocumentationComment var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -5712,7 +5712,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -5857,7 +5857,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor?, + self.getValue(c) as ContainerAccessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -5879,7 +5879,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -5954,7 +5954,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_Inheritable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Inheritable?, + self.getValue(c) as Inheritable, nextProperty, [...remainingNames.skip(1)]); }, @@ -5976,7 +5976,7 @@ class _Renderer_Field extends RendererBase { var nextProperty = _Renderer_ContainerAccessor.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ContainerAccessor?, + self.getValue(c) as ContainerAccessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -6333,7 +6333,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6347,7 +6347,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'Expression?'), + c, remainingNames, 'Expression'), isNullValue: (CT_ c) => c.constantInitializer == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6515,7 +6515,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor?, + self.getValue(c) as Accessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -6656,7 +6656,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -6762,7 +6762,7 @@ class _Renderer_GetterSetterCombo extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor?, + self.getValue(c) as Accessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -6813,7 +6813,7 @@ class _Renderer_HasNoPage extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -6835,7 +6835,7 @@ class _Renderer_HasNoPage extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -6901,7 +6901,7 @@ class _Renderer_Indexable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -6927,7 +6927,7 @@ class _Renderer_Indexable extends RendererBase { getValue: (CT_ c) => c.overriddenDepth, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'int?'), + self.renderSimpleVariable(c, remainingNames, 'int'), isNullValue: (CT_ c) => c.overriddenDepth == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -6981,7 +6981,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library?, + self.getValue(c) as Library, nextProperty, [...remainingNames.skip(1)]); }, @@ -7003,7 +7003,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement?, + self.getValue(c) as ModelElement, nextProperty, [...remainingNames.skip(1)]); }, @@ -7072,7 +7072,7 @@ class _Renderer_Inheritable extends RendererBase { var nextProperty = _Renderer_Inheritable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Inheritable?, + self.getValue(c) as Inheritable, nextProperty, [...remainingNames.skip(1)]); }, @@ -7588,7 +7588,7 @@ class _Renderer_InheritingContainer extends RendererBase { _Renderer_DefinedElementType.propertyMap() .getValue(name); return nextProperty.renderVariable( - self.getValue(c) as DefinedElementType?, + self.getValue(c) as DefinedElementType, nextProperty, [...remainingNames.skip(1)]); }, @@ -7852,7 +7852,7 @@ class _Renderer_LanguageFeature extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -7896,7 +7896,7 @@ class _Renderer_LanguageFeature extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -7972,7 +7972,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -8045,7 +8045,7 @@ class _Renderer_Library extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -8174,7 +8174,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement?, + self.getValue(c) as ModelElement, nextProperty, [...remainingNames.skip(1)]); }, @@ -8303,7 +8303,7 @@ class _Renderer_Library extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -8441,7 +8441,7 @@ class _Renderer_Library extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'PackageMeta?'), + c, remainingNames, 'PackageMeta'), isNullValue: (CT_ c) => c.packageMeta == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -8908,7 +8908,7 @@ class _Renderer_Locatable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -9019,7 +9019,7 @@ class _Renderer_MarkdownFileDocumentation getValue: (CT_ c) => c.documentationFile, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'File?'), + self.renderSimpleVariable(c, remainingNames, 'File'), isNullValue: (CT_ c) => c.documentationFile == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9178,7 +9178,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -9194,7 +9194,7 @@ class _Renderer_Method extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9294,7 +9294,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -9371,7 +9371,7 @@ class _Renderer_Method extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ExecutableMember?'), + c, remainingNames, 'ExecutableMember'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -9391,7 +9391,7 @@ class _Renderer_Method extends RendererBase { var nextProperty = _Renderer_Method.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Method?, + self.getValue(c) as Method, nextProperty, [...remainingNames.skip(1)]); }, @@ -10099,7 +10099,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library?, + self.getValue(c) as Library, nextProperty, [...remainingNames.skip(1)]); }, @@ -10121,7 +10121,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement?, + self.getValue(c) as ModelElement, nextProperty, [...remainingNames.skip(1)]); }, @@ -10138,7 +10138,7 @@ class _Renderer_ModelElement extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -10255,7 +10255,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement?, + self.getValue(c) as ModelElement, nextProperty, [...remainingNames.skip(1)]); }, @@ -10409,7 +10409,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -10643,7 +10643,7 @@ class _Renderer_ModelElement extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -10681,8 +10681,7 @@ class _Renderer_ModelElement extends RendererBase { getValue: (CT_ c) => c.modelNode, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable( - c, remainingNames, 'ModelNode?'), + self.renderSimpleVariable(c, remainingNames, 'ModelNode'), isNullValue: (CT_ c) => c.modelNode == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -10737,7 +10736,7 @@ class _Renderer_ModelElement extends RendererBase { getValue: (CT_ c) => c.originalMember, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Member?'), + self.renderSimpleVariable(c, remainingNames, 'Member'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -11015,7 +11014,7 @@ class _Renderer_ModelFunctionTyped extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -11095,7 +11094,7 @@ class _Renderer_ModelFunctionTyped extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -11564,7 +11563,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -11620,7 +11619,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -11714,7 +11713,7 @@ class _Renderer_Package extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -11790,7 +11789,7 @@ class _Renderer_Package extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element?'), + self.renderSimpleVariable(c, remainingNames, 'Element'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -12525,7 +12524,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -12561,7 +12560,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_ModelElement.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ModelElement?, + self.getValue(c) as ModelElement, nextProperty, [...remainingNames.skip(1)]); }, @@ -12603,7 +12602,7 @@ class _Renderer_Parameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -12708,7 +12707,7 @@ class _Renderer_Parameter extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'ParameterMember?'), + c, remainingNames, 'ParameterMember'), isNullValue: (CT_ c) => c.originalMember == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13114,7 +13113,7 @@ class _Renderer_SourceCode extends RendererBase { renderVariable: (CT_ c, Property self, List remainingNames) => self.renderSimpleVariable( - c, remainingNames, 'CharacterLocation?'), + c, remainingNames, 'CharacterLocation'), isNullValue: (CT_ c) => c.characterLocation == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13127,7 +13126,7 @@ class _Renderer_SourceCode extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element?'), + self.renderSimpleVariable(c, remainingNames, 'Element'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13153,7 +13152,7 @@ class _Renderer_SourceCode extends RendererBase { var nextProperty = _Renderer_Library.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Library?, + self.getValue(c) as Library, nextProperty, [...remainingNames.skip(1)]); }, @@ -13168,8 +13167,7 @@ class _Renderer_SourceCode extends RendererBase { getValue: (CT_ c) => c.modelNode, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable( - c, remainingNames, 'ModelNode?'), + self.renderSimpleVariable(c, remainingNames, 'ModelNode'), isNullValue: (CT_ c) => c.modelNode == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -13327,7 +13325,7 @@ class _Renderer_TemplateData var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -13349,7 +13347,7 @@ class _Renderer_TemplateData var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -13541,7 +13539,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -13694,7 +13692,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_Documentable.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Documentable?, + self.getValue(c) as Documentable, nextProperty, [...remainingNames.skip(1)]); }, @@ -13739,7 +13737,7 @@ class _Renderer_TemplateDataBase extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -14557,7 +14555,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -14659,7 +14657,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor?, + self.getValue(c) as Accessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -14681,7 +14679,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -14756,7 +14754,7 @@ class _Renderer_TopLevelVariable extends RendererBase { var nextProperty = _Renderer_Accessor.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Accessor?, + self.getValue(c) as Accessor, nextProperty, [...remainingNames.skip(1)]); }, @@ -14855,7 +14853,7 @@ class _Renderer_TypeParameter extends RendererBase { var nextProperty = _Renderer_ElementType.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as ElementType?, + self.getValue(c) as ElementType, nextProperty, [...remainingNames.skip(1)]); }, @@ -14921,7 +14919,7 @@ class _Renderer_TypeParameter extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -15266,7 +15264,7 @@ class _Renderer_Typedef extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -15368,7 +15366,7 @@ class _Renderer_Typedef extends RendererBase { var nextProperty = _Renderer_String.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as String?, + self.getValue(c) as String, nextProperty, [...remainingNames.skip(1)]); }, @@ -15711,7 +15709,7 @@ class _Renderer_Warnable extends RendererBase { getValue: (CT_ c) => c.element, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'Element?'), + self.renderSimpleVariable(c, remainingNames, 'Element'), isNullValue: (CT_ c) => c.element == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { diff --git a/lib/src/mustachio/renderer_base.dart b/lib/src/mustachio/renderer_base.dart index aca76ee8e0..8d8fbc6381 100644 --- a/lib/src/mustachio/renderer_base.dart +++ b/lib/src/mustachio/renderer_base.dart @@ -165,15 +165,15 @@ abstract class RendererBase { String get contextChainString => parent == null ? '$T' : '${parent!.contextChainString} > $T'; - /// Returns the [Property] on this renderer named [name]. + /// Returns the [Property] on this renderer named [key]. /// - /// If no property named [name] exists for this renderer, `null` is returned. + /// If no property named [key] exists for this renderer, `null` is returned. Property? getProperty(String key); - /// Resolves [names] into one or more field accesses, returning the result as + /// Resolves [node] into one or more field accesses, returning the result as /// a String. /// - /// [names] may have multiple dot-separate names, and [names] may not be a + /// [node]'s `key` may have multiple dot-separate names, and it may not be a /// valid property of _this_ context type, in which the [parent] renderer is /// referenced. String getFields(Variable node) { @@ -347,13 +347,13 @@ class SimpleRenderer extends RendererBase { /// rendering various types of Mustache nodes. @immutable class Property { - /// Gets the value of this property on the object [context]. + /// Gets the value of this property on the object `context`. final Object? Function(T context) getValue; final String Function(T, Property, List) renderVariable; /// Gets the bool value (true or false, never null) of this property on the - /// object [context]. + /// object `context`. final bool Function(T context)? getBool; final Iterable Function( diff --git a/test/mustachio/foo.runtime_renderers.dart b/test/mustachio/foo.runtime_renderers.dart index 661c767c1f..204b97b51f 100644 --- a/test/mustachio/foo.runtime_renderers.dart +++ b/test/mustachio/foo.runtime_renderers.dart @@ -50,7 +50,7 @@ class Renderer_Bar extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Baz.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Baz?, + return nextProperty.renderVariable(self.getValue(c) as Baz, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.baz == null, @@ -69,7 +69,7 @@ class Renderer_Bar extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Foo.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Foo?, + return nextProperty.renderVariable(self.getValue(c) as Foo, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.foo == null, @@ -82,14 +82,14 @@ class Renderer_Bar extends RendererBase { getValue: (CT_ c) => c.l1, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'bool?'), + self.renderSimpleVariable(c, remainingNames, 'bool'), getBool: (CT_ c) => c.l1 == true, ), 's2': Property( getValue: (CT_ c) => c.s2, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String?'), + self.renderSimpleVariable(c, remainingNames, 'String'), isNullValue: (CT_ c) => c.s2 == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -143,7 +143,7 @@ class Renderer_Baz extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Bar.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Bar?, + return nextProperty.renderVariable(self.getValue(c) as Bar, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.bar == null, @@ -205,7 +205,7 @@ class Renderer_Foo extends RendererBase { var name = remainingNames.first; var nextProperty = Renderer_Baz.propertyMap().getValue(name); - return nextProperty.renderVariable(self.getValue(c) as Baz?, + return nextProperty.renderVariable(self.getValue(c) as Baz, nextProperty, [...remainingNames.skip(1)]); }, isNullValue: (CT_ c) => c.baz == null, @@ -230,7 +230,7 @@ class Renderer_Foo extends RendererBase { getValue: (CT_ c) => c.length, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'int?'), + self.renderSimpleVariable(c, remainingNames, 'int'), isNullValue: (CT_ c) => c.length == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -249,7 +249,7 @@ class Renderer_Foo extends RendererBase { var nextProperty = Renderer_Property1.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property1?, + self.getValue(c) as Property1, nextProperty, [...remainingNames.skip(1)]); }, @@ -263,7 +263,7 @@ class Renderer_Foo extends RendererBase { getValue: (CT_ c) => c.s1, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String?'), + self.renderSimpleVariable(c, remainingNames, 'String'), isNullValue: (CT_ c) => c.s1 == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -350,7 +350,7 @@ class Renderer_Mixin1 extends RendererBase { var nextProperty = Renderer_Property3.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property3?, + self.getValue(c) as Property3, nextProperty, [...remainingNames.skip(1)]); }, @@ -435,7 +435,7 @@ class Renderer_Property1 extends RendererBase { var nextProperty = Renderer_Property2.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as Property2?, + self.getValue(c) as Property2, nextProperty, [...remainingNames.skip(1)]); }, @@ -480,7 +480,7 @@ class Renderer_Property2 extends RendererBase { getValue: (CT_ c) => c.s, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String?'), + self.renderSimpleVariable(c, remainingNames, 'String'), isNullValue: (CT_ c) => c.s == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { @@ -522,7 +522,7 @@ class Renderer_Property3 extends RendererBase { getValue: (CT_ c) => c.s, renderVariable: (CT_ c, Property self, List remainingNames) => - self.renderSimpleVariable(c, remainingNames, 'String?'), + self.renderSimpleVariable(c, remainingNames, 'String'), isNullValue: (CT_ c) => c.s == null, renderValue: (CT_ c, RendererBase r, List ast, StringSink sink) { diff --git a/tool/mustachio/codegen_runtime_renderer.dart b/tool/mustachio/codegen_runtime_renderer.dart index 10c48f7329..780d1da95b 100644 --- a/tool/mustachio/codegen_runtime_renderer.dart +++ b/tool/mustachio/codegen_runtime_renderer.dart @@ -474,21 +474,25 @@ class ${renderer._rendererClassName}${renderer._typeParametersString} .writeln('getValue: ($_contextTypeVariable c) => c.${property.name},'); var getterName = property.name; - var getterTypeString = getterType.getDisplayString(); + var getterTypeString = + _typeSystem.promoteToNonNull(getterType).getDisplayString(); // Only add a `getProperties` function, which returns the property map for // [getterType], if [getterType] is a renderable type. if (_typeToRendererClassName.containsKey(getterType.element)) { var rendererClassName = _typeToRendererClassName[getterType.element]; _buffer.writeln(''' renderVariable: - ($_contextTypeVariable c, Property<$_contextTypeVariable> self, List remainingNames) { + ($_contextTypeVariable c, + Property<$_contextTypeVariable> self, + List remainingNames) { if (remainingNames.isEmpty) { return self.getValue(c).toString(); } var name = remainingNames.first; var nextProperty = $rendererClassName.propertyMap().getValue(name); return nextProperty.renderVariable( - self.getValue(c) as $getterTypeString, nextProperty, [...remainingNames.skip(1)]); + self.getValue(c) as $getterTypeString, + nextProperty, [...remainingNames.skip(1)]); }, '''); } else { From f8e53b48905924e67bc481e19dfd6c553ea98b7f Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 30 Apr 2024 14:20:52 -0700 Subject: [PATCH 4/4] Only test on dev SDK --- .github/workflows/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dd1e8ebfc7..47847870b8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,7 +22,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - sdk: [dev, stable] + # TODO(srawlins): Re-enable stable after 3.4.0 ships. + # sdk: [dev, stable] + sdk: [dev] job: [main, flutter, packages, sdk-docs] include: - os: macos-latest