Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: tests/compiler/dart2js/resolver_test.dart

Issue 1274073003: Refactor visitSendSet for super compounds and assignment. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Use bug number for TODOs Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 35c2dedc74a1d6b0dca99abdd53464421304c79a..2547f90539cb0c0b6431f262a88127a65ee49f4c 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -1255,7 +1255,9 @@ testCantAssignMethods() {
super.mname = () => 6;
}
}
- ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER]);
+ ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER,
+ // TODO(johnniwinther): Avoid duplicate warnings.
+ MessageKind.SETTER_NOT_FOUND]);
// But index operators should be OK
checkWarningOn('''
@@ -1331,7 +1333,9 @@ testCantAssignFinalAndConsts() {
class B extends A {
m() { super.x = 2; }
}
- ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER]);
+ ''', [MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
+ // TODO(johnniwinther): Avoid duplicate warnings.
+ MessageKind.SETTER_NOT_FOUND]);
// But non-final fields are OK:
checkWarningOn('''
@@ -1343,14 +1347,30 @@ testCantAssignFinalAndConsts() {
m() { super.x = 2; }
}
''', []);
+
+ // Check getter without setter.
+ checkWarningOn('''
+ main() => new B().m();
+ class A {
+ get x => 1;
+ }
+ class B extends A {
+ m() { super.x = 2; }
+ }
+ ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+ // TODO(johnniwinther): Avoid duplicate warnings.
+ MessageKind.SETTER_NOT_FOUND]);
}
/// Helper to test that [script] produces all the given [warnings].
checkWarningOn(String script, List<MessageKind> warnings) {
Expect.isTrue(warnings.length >= 0 && warnings.length <= 2);
asyncTest(() => compileScript(script).then((compiler) {
- Expect.equals(0, compiler.errors.length);
- Expect.equals(warnings.length, compiler.warnings.length);
+ Expect.equals(0, compiler.errors.length,
+ 'Unexpected errors in\n$script\n${compiler.errors}');
+ Expect.equals(warnings.length, compiler.warnings.length,
+ 'Unexpected warnings in\n$script\n'
+ 'Expected:$warnings\nFound:${compiler.warnings}');
for (int i = 0; i < warnings.length; i++) {
Expect.equals(warnings[i], compiler.warnings[i].message.kind);
}
« no previous file with comments | « tests/compiler/dart2js/mock_compiler.dart ('k') | tests/compiler/dart2js/semantic_visitor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698