mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
![Samir Jindel](/assets/img/avatar_default.png)
Issue https://github.com/dart-lang/sdk/issues/37680 NativeFunction was not handled despite being concrete. We can just make it (and Void) abstract because they cannot appear directly as the type of native field, only as a type argument. Change-Id: I92c276b7c1c4c98624bf527ccff98f5fd077bf2c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114861 Commit-Queue: Samir Jindel <sjindel@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
76 lines
1.8 KiB
Dart
76 lines
1.8 KiB
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// All imports must be in all FFI patch files to not depend on the order
|
|
// the patches are applied.
|
|
import "dart:_internal" show patch;
|
|
import 'dart:typed_data' show TypedData;
|
|
|
|
// NativeType is not private, because it is used in type arguments.
|
|
// NativeType is abstract because it not used with const constructors in
|
|
// annotations directly, so it should never be instantiated at runtime.
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
abstract class NativeType {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class _NativeInteger extends NativeType {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class _NativeDouble extends NativeType {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Int8 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Int16 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Int32 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Int64 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Uint8 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Uint16 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Uint32 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Uint64 extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class IntPtr extends _NativeInteger {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Float extends _NativeDouble {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
class Double extends _NativeDouble {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
abstract class Void extends NativeType {}
|
|
|
|
@patch
|
|
@pragma("vm:entry-point")
|
|
abstract class NativeFunction<T extends Function> extends NativeType {}
|