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

Unified Diff: test/checker/checker_test.dart

Issue 1055923002: Don't call dinvoke on Object methods (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: modify test Created 5 years, 9 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
« lib/src/checker/rules.dart ('K') | « lib/src/codegen/js_codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/checker/checker_test.dart
diff --git a/test/checker/checker_test.dart b/test/checker/checker_test.dart
index fa98ddb4eb7893a558ca14439fe710f47349f4d2..84d317d44500725a2059a45697f0d5175d523afb 100644
--- a/test/checker/checker_test.dart
+++ b/test/checker/checker_test.dart
@@ -16,7 +16,13 @@ void main() {
test('conversion and dynamic invoke', () {
testChecker({
+ '/helper.dart': '''
+ dynamic toString = (int x) => x + 42;
+ dynamic hashCode = "hello";
+ ''',
'/main.dart': '''
+ import 'helper.dart' as helper;
+
class A {
String x = "hello world";
@@ -58,6 +64,17 @@ void main() {
A.baz2("hello");
var b2 = A.baz2;
(/*warning:DynamicInvoke*/b2("hello"));
+
+ dynamic a1 = new A();
+ (/*warning:DynamicInvoke*/a1.x);
+ a1.toString();
+ a1.hashCode;
+
+ dynamic toString = () => null;
+ (/*warning:DynamicInvoke*/toString());
+
+ (/*warning:DynamicInvoke*/helper.toString());
+ int hashCode = /*info:DynamicCast*/helper.hashCode;
'''
});
});
« lib/src/checker/rules.dart ('K') | « lib/src/codegen/js_codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698