Skip to content

Commit dba74ff

Browse files
authored
[record_use] Mark recorded classes as final (dart-lang#3131)
At this point we don't want to support recording subtypes, we might allow this in the future, but we'll lock it down in the compiler for now.
1 parent f855083 commit dba74ff

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎pkgs/record_use/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class PirateTranslator {
3434
}
3535
3636
@RecordUse()
37-
class PirateShip {
37+
final class PirateShip {
3838
final String name;
3939
final int cannons;
4040

‎pkgs/record_use/example/api/usage.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class PirateTranslator {
2121

2222
// snippet-start#const-instance
2323
@RecordUse()
24-
class PirateShip {
24+
final class PirateShip {
2525
final String name;
2626
final int cannons;
2727

‎pkgs/record_use/lib/src/record_use.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extension type RecordedUsages._(Recordings _recordings) {
8282
/// <!-- file://./../../example/api/usage.dart#const-instance -->
8383
/// ```dart
8484
/// @RecordUse()
85-
/// class PirateShip {
85+
/// final class PirateShip {
8686
/// final String name;
8787
/// final int cannons;
8888
///

‎pkgs/record_use/test_data/drop_data_asset/lib/src/drop_data_asset.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class MyMath {
1515
}
1616

1717
@RecordUse()
18-
class Double {
18+
final class Double {
1919
final int value;
2020
const Double(this.value);
2121

2222
int run() => value + value;
2323
}
2424

2525
@RecordUse()
26-
class Square {
26+
final class Square {
2727
final int value;
2828
const Square(this.value);
2929

‎pkgs/record_use/test_data/drop_dylib_recording/lib/src/drop_dylib_recording.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ class MyMath {
1717
}
1818

1919
@RecordUse()
20-
class Double {
20+
final class Double {
2121
final int value;
2222
const Double(this.value);
2323

2424
int run() => bindings.add(value, value);
2525
}
2626

2727
@RecordUse()
28-
class Square {
28+
final class Square {
2929
final int value;
3030
const Square(this.value);
3131

0 commit comments

Comments
 (0)