Skip to content

Commit

Permalink
Build elements in default values.
Browse files Browse the repository at this point in the history
R=brianwilkerson@google.com

Change-Id: I67c9e15832b28eeb49eeb7f8ecfd91734551b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Jun 6, 2019
1 parent 612a3f8 commit 6e0d978
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/analyzer/lib/src/summary2/default_value_resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/element/builder.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type_algebra.dart';
import 'package:analyzer/src/dart/resolver/scope.dart';
Expand Down Expand Up @@ -90,6 +91,8 @@ class DefaultValueResolver {
}
if (defaultValue == null) return;

defaultValue.accept(LocalElementBuilder(ElementHolder(), null));

var contextType = TypeVariableEliminator(_linker.typeProvider)
.substituteType(parameter.type);
InferenceContext.setType(defaultValue, contextType);
Expand Down

0 comments on commit 6e0d978

Please sign in to comment.