| Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| index 2b30ed75748961fffb2935d3f315695fcea18b95..9e8301744a20eda82ef50556cf92de5436916fc2 100644
|
| --- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
|
| @@ -119,16 +119,18 @@ class _InstrumentationValueForType extends fasta.InstrumentationValue {
|
| }
|
|
|
| void _appendElementName(StringBuffer buffer, Element element) {
|
| - String name = element.name ?? '';
|
| - if (element.library == null) {
|
| - // TODO(scheglov) This is wrong - every element must be in a library.
|
| - buffer.write('<unknown>::$name');
|
| + // Synthetic FunctionElement(s) don't have a name or enclosing library.
|
| + if (element.isSynthetic && element is FunctionElement) {
|
| return;
|
| }
|
| - String libraryName = element.library.name;
|
| - if (libraryName == '') {
|
| - throw new StateError('The element $name must be in a named library.');
|
| +
|
| + LibraryElement library = element.library;
|
| + if (library == null) {
|
| + throw new StateError('Unexpected element without library: $element');
|
| }
|
| + String libraryName = library.name;
|
| +
|
| + String name = element.name ?? '';
|
| if (libraryName != 'dart.core' &&
|
| libraryName != 'dart.async' &&
|
| libraryName != 'test') {
|
|
|