blob: 9e0b8fa9dd8c4fb95c318840b02e3dae65034ac4 [file] [log] [blame]
part of Expect;
typedef F<X> = void Function<Y extends X>();
typedef expected_target = Function<X>();
// Functions for correct type comparison in language feature tests
F<X> toF<X>(X x) => <Y extends X>() {};
Type typeOf<X>() => X;
// Function to check nnbd_top_merge feature
T Function(T) get f => (x) => x;
// Functions to check least and greatest closures
// See
Type? _capturedTypeArgument;
X captureTypeArgument<X>() {
_capturedTypeArgument = X;
throw "Error";
Type? get capturedTypeArgument {
var result = _capturedTypeArgument;
_capturedTypeArgument = null;
return result;
// Sound/Unsound null safety flags (formerly known as weak/strong mode)
bool get hasUnsoundNullSafety => const <Null>[] is List<Object>;
bool get hasSoundNullSafety => !hasUnsoundNullSafety;