Skip to content

Commit

Permalink
Reland "[vm/ffi] Remove deprecated Struct.addressOf getter"
Browse files Browse the repository at this point in the history
This got deprecated in Dart 2.12 stable. Removing for the next release.

Closes: #40667

This reverts commit 1d1f68f.

Change-Id: I1df84f2225ea68c2d8ccb7d3e6359050e8802f62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188291
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
  • Loading branch information
dcharkes authored and commit-bot@chromium.org committed Mar 1, 2021
1 parent 696057e commit b21430a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions sdk/lib/ffi/struct.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,3 @@ abstract class Struct extends NativeType {

Struct._fromPointer(this._addressOf);
}

/// Extension on [Struct] specialized for its subtypes.
extension StructAddressOf<T extends Struct> on T {
/// Returns the address backing the reference.
@Deprecated('Hold on to the pointer backing a struct instead.')
Pointer<T> get addressOf => _addressOf as Pointer<T>;
}
2 changes: 0 additions & 2 deletions tests/ffi/structs_nnbd_workaround_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ void testTypeTest() {
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
// TODO(https://dartbug.com/40667): Remove support for this.
Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}

Expand Down
2 changes: 0 additions & 2 deletions tests/ffi/structs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ void testTypeTest() {
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
// TODO(https://dartbug.com/40667): Remove support for this.
Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}

Expand Down
2 changes: 0 additions & 2 deletions tests/ffi_2/structs_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ void testTypeTest() {
final pointer = calloc<Coordinate>();
Coordinate c = pointer.ref;
Expect.isTrue(c is Struct);
// TODO(https://dartbug.com/40667): Remove support for this.
Expect.isTrue(c.addressOf is Pointer<Coordinate>);
calloc.free(pointer);
}

Expand Down

0 comments on commit b21430a

Please sign in to comment.