Files
sdk/pkg/front_end/testcases/general/issue43721.dart.weak.expect
T
Johnni Winther fdc765faad [cfe] Make TypeParameter.defaultType non-nullable
TEST=existing

Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-21 13:51:50 +00:00

28 lines
1.0 KiB
Plaintext

library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/issue43721.dart:18:3: Error: Inferred type argument 'FutureOr<num>' doesn't conform to the bound 'FutureOr<int>' of the type variable 'T' on 'error'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// error(z); // Error.
// ^
// pkg/front_end/testcases/general/issue43721.dart:10:7: Context: This is the type variable whose bound isn't conformed to.
// error<T extends FutureOr<int>>(T t) {}
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async";
static method ok<T extends FutureOr<core::num*>*>(self::ok::T* t) → dynamic {}
static method error<T extends FutureOr<core::int*>*>(self::error::T* t) → dynamic {}
static method bar(core::bool* condition) → dynamic {
FutureOr<core::int*>* x = null;
core::num* n = 1;
FutureOr<core::num*>* z = condition ?{FutureOr<core::num*>*} x : n;
self::ok<FutureOr<core::num*>*>(z);
self::error<FutureOr<core::num*>*>(z);
}
static method main() → dynamic {}