File tree Expand file tree Collapse file tree 3 files changed +83
-0
lines changed
tests/hot_reload/super_call_regress_59628 Expand file tree Collapse file tree 3 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "exclude" : []
3+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2024, 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+
5+ import 'package:expect/expect.dart' ;
6+ import 'package:reload_test/reload_test_utils.dart' ;
7+
8+ // Regression test for https://github.com/dart-lang/sdk/issues/59628.
9+
10+ class A {
11+ method () {
12+ return 'A.method' ;
13+ }
14+ }
15+
16+ class B extends A {
17+ method () {
18+ return '${super .method ()} - B.method' ;
19+ }
20+ }
21+
22+ String unrelatedChange () => 'before' ;
23+
24+ Future <void > main () async {
25+ Expect .equals ('before' , unrelatedChange ());
26+ var b = B ();
27+ Expect .equals ('A.method - B.method' , b.method ());
28+ await hotReload ();
29+ Expect .equals ('after' , unrelatedChange ());
30+ Expect .equals ('A.method - B.method' , b.method ());
31+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2024, 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+
5+ import 'package:expect/expect.dart' ;
6+ import 'package:reload_test/reload_test_utils.dart' ;
7+
8+ // Regression test for https://github.com/dart-lang/sdk/issues/59628.
9+
10+ class A {
11+ method () {
12+ return 'A.method' ;
13+ }
14+ }
15+
16+ class B extends A {
17+ method () {
18+ return '${super .method ()} - B.method' ;
19+ }
20+ }
21+
22+ String unrelatedChange () => 'after' ;
23+
24+ Future <void > main () async {
25+ Expect .equals ('before' , unrelatedChange ());
26+ var b = B ();
27+ Expect .equals ('A.method - B.method' , b.method ());
28+ await hotReload ();
29+ Expect .equals ('after' , unrelatedChange ());
30+ Expect .equals ('A.method - B.method' , b.method ());
31+ }
32+
33+ /** DIFF **/
34+ /*
35+ @@ -19,7 +19,7 @@
36+ }
37+ }
38+
39+ -String unrelatedChange() => 'before';
40+ +String unrelatedChange() => 'after';
41+
42+ Future<void> main() async {
43+ Expect.equals('before', unrelatedChange());
44+ @@ -29,3 +29,4 @@
45+ Expect.equals('after', unrelatedChange());
46+ Expect.equals('A.method - B.method', b.method());
47+ }
48+ +
49+ */
You can’t perform that action at this time.
0 commit comments