blob: 1da6b7f11420dc5e72be1a8804510d907b5d9b60 [file] [log] [blame]
// 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.
import 'dart:_runtime' as dart;
/// The runtime representation of the never type.
final neverType = dart.wrapType(dart.never_);
/// Sets the mode of the runtime subtype checks.
///
/// In tests the mode should be set only once at the very beginning of the test.
/// Changing the mode after any calls to dart.isSubtype() is not supported.
void strictSubtypeChecks(bool flag) => dart.strictSubtypeChecks(flag);
/// Returns tWrapped? as a wrapped type.
Type nullable(Type tWrapped) {
var t = dart.unwrapType(tWrapped);
var tNullable = dart.nullable(t);
return dart.wrapType(tNullable);
}
/// Returns tWrapped* as a wrapped type.
Type legacy(Type tWrapped) {
var t = dart.unwrapType(tWrapped);
var tLegacy = dart.legacy(t);
return dart.wrapType(tLegacy);
}