Index: pkg/analyzer/lib/src/dart/element/element.dart |
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart |
index 78d0f5f496275bf18d56e98cef9fd068b33ae782..8e7ca3c3fb71c3f82740c5eaf1e09153002bc6fb 100644 |
--- a/pkg/analyzer/lib/src/dart/element/element.dart |
+++ b/pkg/analyzer/lib/src/dart/element/element.dart |
@@ -1827,7 +1827,7 @@ class DefaultParameterElementImpl extends ParameterElementImpl |
@override |
Expression get constantInitializer { |
if (_unlinkedParam != null) { |
- UnlinkedConst defaultValue = _unlinkedParam.defaultValue; |
+ UnlinkedConst defaultValue = _unlinkedParam.initializer?.bodyExpr; |
if (defaultValue == null) { |
return null; |
} |
@@ -5748,7 +5748,7 @@ class ParameterElementImpl extends VariableElementImpl |
@override |
String get defaultValueCode { |
if (_unlinkedParam != null) { |
- if (_unlinkedParam.defaultValue == null) { |
+ if (_unlinkedParam.initializer?.bodyExpr == null) { |
return null; |
} |
return _unlinkedParam.defaultValueCode; |