File tree Expand file tree Collapse file tree 22 files changed +659
-0
lines changed
generic_constructor_tear_off
implicit_constructor_changed
shape_change_retains_hash
static_tear_off_retains_hash Expand file tree Collapse file tree 22 files changed +659
-0
lines changed 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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L561
10+
11+ helper () {
12+ return 'hello' ;
13+ }
14+
15+ Future <void > main () async {
16+ Expect .equals ('hello' , helper ());
17+ await hotReload ();
18+
19+ Expect .equals ('hello from A' , helper ());
20+ }
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L561
10+
11+ helper () {
12+ return A ().toString ();
13+ }
14+
15+ class A {
16+ toString () => 'hello from A' ;
17+ }
18+
19+ Future <void > main () async {
20+ Expect .equals ('hello' , helper ());
21+ await hotReload ();
22+
23+ Expect .equals ('hello from A' , helper ());
24+ }
25+ /** DIFF **/
26+ /*
27+ @@ -9,7 +9,11 @@
28+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L561
29+
30+ helper() {
31+ - return 'hello';
32+ + return A().toString();
33+ +}
34+ +
35+ +class A {
36+ + toString() => 'hello from A';
37+ }
38+
39+ Future<void> main() async {
40+ */
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L585
10+
11+ class A {
12+ toString () => 'hello from A' ;
13+ }
14+ var list = < dynamic > [];
15+ helper () {
16+ list.add (A ());
17+ return list[0 ].toString ();
18+ }
19+
20+ Future <void > main () async {
21+ Expect .equals ('hello from A' , helper ());
22+ await hotReload ();
23+
24+ Expect .equals ('hello from A' , helper ());
25+ }
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L585
10+
11+ var list = < dynamic > [];
12+ helper () {
13+ return list[0 ].toString ();
14+ }
15+
16+ Future <void > main () async {
17+ Expect .equals ('hello from A' , helper ());
18+ await hotReload ();
19+
20+ Expect .equals ('hello from A' , helper ());
21+ }
22+ /** DIFF **/
23+ /*
24+ @@ -8,12 +8,8 @@
25+ // Adapted from:
26+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L585
27+
28+ -class A {
29+ - toString() => 'hello from A';
30+ -}
31+ var list = <dynamic>[];
32+ helper() {
33+ - list.add(A());
34+ return list[0].toString();
35+ }
36+
37+ */
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L723
10+
11+ class A {
12+ late int field;
13+ A () {
14+ field = 20 ;
15+ }
16+ }
17+
18+ var savedA = A ();
19+ helper () {
20+ return A ();
21+ }
22+
23+ Future <void > main () async {
24+ Expect .equals (20 , savedA.field);
25+ Expect .equals (20 , helper ().field);
26+ await hotReload ();
27+
28+ Expect .equals (20 , savedA.field);
29+ Expect .equals (10 , helper ().field);
30+ }
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L723
10+
11+ class A {
12+ late int field;
13+ A () {
14+ field = 10 ;
15+ }
16+ }
17+
18+ var savedA = A ();
19+ helper () {
20+ return A ();
21+ }
22+
23+ Future <void > main () async {
24+ Expect .equals (20 , savedA.field);
25+ Expect .equals (20 , helper ().field);
26+ await hotReload ();
27+
28+ Expect .equals (20 , savedA.field);
29+ Expect .equals (10 , helper ().field);
30+ }
31+ /** DIFF **/
32+ /*
33+ @@ -11,7 +11,7 @@
34+ class A {
35+ late int field;
36+ A() {
37+ - field = 20;
38+ + field = 10;
39+ }
40+ }
41+
42+ */
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L4638
10+ // Regression test for https://github.com/dart-lang/sdk/issues/50148
11+
12+ typedef Create <T , R > = T Function (R ref);
13+
14+ class Base <Input > {
15+ Base (void Function (Create <void , Input > create) factory ) : _factory = factory ;
16+
17+ final void Function (Create <void , Input > create) _factory;
18+
19+ void fn () => _factory ((ref) {});
20+ }
21+
22+ class Check <T > {
23+ Check (Create <Object ?, List <T >> create);
24+ }
25+
26+ final f = Base <List <int >>(Check <int >.new );
27+
28+ helper () {
29+ f.fn ();
30+ }
31+
32+ Future <void > main () async {
33+ helper ();
34+ await hotReload ();
35+ helper ();
36+ }
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L4638
10+ // Regression test for https://github.com/dart-lang/sdk/issues/50148
11+
12+ typedef Create <T , R > = T Function (R ref);
13+
14+ class Base <Input > {
15+ Base (void Function (Create <void , Input > create) factory ) : _factory = factory ;
16+
17+ final void Function (Create <void , Input > create) _factory;
18+
19+ void fn () => _factory ((ref) {});
20+ }
21+
22+ class Check <T > {
23+ Check (Create <Object ?, List <T >> create);
24+ }
25+
26+ final f = Base <List <int >>(Check <int >.new );
27+
28+ helper () {
29+ f.fn ();
30+ }
31+
32+ Future <void > main () async {
33+ helper ();
34+ await hotReload ();
35+ helper ();
36+ }
37+ /** DIFF **/
38+ /*
39+ */
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L690
10+
11+ class A {
12+ int field = 20 ;
13+ }
14+
15+ var savedA = A ();
16+ helper () {
17+ return A ();
18+ }
19+
20+ Future <void > main () async {
21+ Expect .equals (20 , savedA.field);
22+ Expect .equals (20 , helper ().field);
23+ await hotReload ();
24+
25+ Expect .equals (20 , savedA.field);
26+ Expect .equals (10 , helper ().field);
27+ }
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+ // Adapted from:
9+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L690
10+
11+ class A {
12+ int field = 10 ;
13+ }
14+
15+ var savedA = A ();
16+ helper () {
17+ return A ();
18+ }
19+
20+ Future <void > main () async {
21+ Expect .equals (20 , savedA.field);
22+ Expect .equals (20 , helper ().field);
23+ await hotReload ();
24+
25+ Expect .equals (20 , savedA.field);
26+ Expect .equals (10 , helper ().field);
27+ }
28+ /** DIFF **/
29+ /*
30+ @@ -9,7 +9,7 @@
31+ // https://github.com/dart-lang/sdk/blob/f34a2ed99fc1b34cedbd974a5801f8d922121126/runtime/vm/isolate_reload_test.cc#L690
32+
33+ class A {
34+ - int field = 20;
35+ + int field = 10;
36+ }
37+
38+ var savedA = A();
39+ */
You can’t perform that action at this time.
0 commit comments