Skip to content

Commit

Permalink
[vm] Further mirrors and test fixes.
Browse files Browse the repository at this point in the history
Bug: #40497
Change-Id: Ieed8a51600f92fa4dc9137bf1f4ed58bb4cfa598
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
rmacnak-google authored and commit-bot@chromium.org committed Feb 10, 2020
1 parent 63b5d2b commit 0fde59b
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion runtime/vm/object.cc
Expand Up @@ -8565,7 +8565,7 @@ void Function::PrintQualifiedName(NameVisibility name_visibility,
}

RawString* Function::GetSource() const {
if (IsImplicitConstructor() || IsSignatureFunction()) {
if (IsImplicitConstructor() || IsSignatureFunction() || is_synthetic()) {
// We may need to handle more cases when the restrictions on mixins are
// relaxed. In particular we might start associating some source with the
// forwarding constructors when it becomes possible to specify a particular
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/mirrors/constructors_test.dart
Expand Up @@ -11,7 +11,7 @@ import 'package:expect/expect.dart';
import 'stringify.dart';

constructorsOf(ClassMirror cm) {
var result = new Map();
var result = new Map<Symbol, MethodMirror>();
cm.declarations.forEach((k, v) {
if (v is MethodMirror && v.isConstructor) result[k] = v;
});
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/mirrors/instance_members_easier_test.dart
Expand Up @@ -9,8 +9,8 @@ import 'package:expect/expect.dart';

import 'declarations_model_easier.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

class EasierSuperclass {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/mirrors/instance_members_test.dart
Expand Up @@ -9,8 +9,8 @@ import 'package:expect/expect.dart';

import 'declarations_model.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/mirrors/instance_members_with_override_test.dart
Expand Up @@ -28,8 +28,8 @@ abstract class C extends S {
/* abstract */ notOverridden();
}

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/mirrors/other_declarations_location_test.dart
Expand Up @@ -42,7 +42,7 @@ main() {
expectLocation(reflectClass(C).declarations[#c]!, mainSuffix, 17, 14);
expectLocation(reflectClass(C).declarations[#d]!, mainSuffix, 18, 16);
expectLocation(reflectClass(C).declarations[#e]!, mainSuffix, 20, 7);
expectLocation(reflectClass(C).declarations[#f]!, mainSuffix, 21, 11);
expectLocation(reflectClass(C).declarations[#f]!, mainSuffix, 21, 16);

// Type variables.
expectLocation(reflectClass(C).declarations[#S]!, mainSuffix, 14, 9);
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/mirrors/static_members_easier_test.dart
Expand Up @@ -10,8 +10,8 @@ import 'package:expect/expect.dart';
import 'stringify.dart';
import 'declarations_model_easier.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/mirrors/static_members_test.dart
Expand Up @@ -10,8 +10,8 @@ import 'package:expect/expect.dart';
import 'stringify.dart';
import 'declarations_model.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib_2/mirrors/constructors_test.dart
Expand Up @@ -11,7 +11,7 @@ import 'package:expect/expect.dart';
import 'stringify.dart';

constructorsOf(ClassMirror cm) {
var result = new Map();
var result = new Map<Symbol, MethodMirror>();
cm.declarations.forEach((k, v) {
if (v is MethodMirror && v.isConstructor) result[k] = v;
});
Expand Down
4 changes: 2 additions & 2 deletions tests/lib_2/mirrors/instance_members_easier_test.dart
Expand Up @@ -9,8 +9,8 @@ import 'package:expect/expect.dart';

import 'declarations_model_easier.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

class EasierSuperclass {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib_2/mirrors/instance_members_test.dart
Expand Up @@ -9,8 +9,8 @@ import 'package:expect/expect.dart';

import 'declarations_model.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib_2/mirrors/instance_members_with_override_test.dart
Expand Up @@ -28,8 +28,8 @@ abstract class C extends S {
/* abstract */ notOverridden();
}

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib_2/mirrors/static_members_easier_test.dart
Expand Up @@ -10,8 +10,8 @@ import 'package:expect/expect.dart';
import 'stringify.dart';
import 'declarations_model_easier.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down
4 changes: 2 additions & 2 deletions tests/lib_2/mirrors/static_members_test.dart
Expand Up @@ -10,8 +10,8 @@ import 'package:expect/expect.dart';
import 'stringify.dart';
import 'declarations_model.dart' as declarations_model;

selectKeys(map, predicate) {
return map.keys.where((key) => predicate(map[key]));
selectKeys<K, V>(Map<K, V> map, bool Function(V) predicate) {
return map.keys.where((K key) => predicate(map[key]));
}

main() {
Expand Down

0 comments on commit 0fde59b

Please sign in to comment.