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

Side by Side Diff: tests/language_strong/dynamic_invoke_test.dart

Issue 2848153002: fix #29504, dcall on object member when a temporary was involved. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 // Dart test program for testing dynamic calls.
5
6 import "package:expect/expect.dart";
7
8 // Make this something that DDC considers side effecting.
9 dynamic get d => "hello";
10
11 regress29504() {
12 // These forms were being incorrectly generated as dynamic invokes, which is
13 // not supposed to be done for the Object members that are always present on
14 // all Dart types, including `null`.
15 //
16 // See https://github.com/dart-lang/sdk/issues/29504
17 //
18 // What we're testing here is that none of these generate dynamic invokes,
19 // because that will throw a NoSuchMethod error if it happens.
20 Expect.equals(d.runtimeType, String);
21 Expect.equals(d?.runtimeType, String);
22 Expect.equals(d..runtimeType, "hello");
23
24 Expect.equals(d.hashCode, "hello".hashCode);
25 Expect.equals(d?.hashCode, "hello".hashCode);
26 Expect.equals(d..hashCode, "hello");
27
28 Expect.equals(d.toString(), "hello");
29 Expect.equals(d?.toString(), "hello");
30 Expect.equals(d..toString(), "hello");
31 }
32
33 main() {
34 regress29504();
35 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/code_generator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698