mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
![Sigmund Cherem](/assets/img/avatar_default.png)
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680 Commit-Queue: Sigmund Cherem <sigmund@google.com> Reviewed-by: Joshua Litt <joshualitt@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com> Reviewed-by: Stephen Adams <sra@google.com>
66 lines
1.9 KiB
Dart
66 lines
1.9 KiB
Dart
// Copyright (c) 2020, 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:async';
|
|
import 'package:expect/expect.dart';
|
|
|
|
get b => 499;
|
|
@pragma('dart2js:noInline')
|
|
get b_noInline => b;
|
|
const b0 = 499 is FutureOr<int>;
|
|
final b1 = 499 is FutureOr<int>;
|
|
get b2 => 499 is FutureOr<int>;
|
|
get b3 => b is FutureOr<int>;
|
|
get b4 => b_noInline is FutureOr<int>;
|
|
|
|
get c => 499;
|
|
@pragma('dart2js:noInline')
|
|
get c_noInline => c;
|
|
const c0 = 499 is FutureOr<FutureOr<int>>;
|
|
final c1 = 499 is FutureOr<FutureOr<int>>;
|
|
get c2 => 499 is FutureOr<FutureOr<int>>;
|
|
get c3 => c is FutureOr<FutureOr<int>>;
|
|
get c4 => c_noInline is FutureOr<FutureOr<int>>;
|
|
|
|
get d => 499.0;
|
|
@pragma('dart2js:noInline')
|
|
get d_noInline => d;
|
|
const d0 = 499.0 is FutureOr<int>;
|
|
final d1 = 499.0 is FutureOr<int>;
|
|
get d2 => 499.0 is FutureOr<int>;
|
|
get d3 => d is FutureOr<int>;
|
|
get d4 => d_noInline is FutureOr<int>;
|
|
|
|
get e => 499;
|
|
@pragma('dart2js:noInline')
|
|
get e_noInline => e;
|
|
const e0 = 499 is FutureOr<double>;
|
|
final e1 = 499 is FutureOr<double>;
|
|
get e2 => 499 is FutureOr<double>;
|
|
get e3 => e is FutureOr<double>;
|
|
get e4 => e_noInline is FutureOr<double>;
|
|
|
|
get f => 499;
|
|
@pragma('dart2js:noInline')
|
|
get f_noInline => f;
|
|
const f0 = 499 is FutureOr<FutureOr<double>>;
|
|
final f1 = 499 is FutureOr<FutureOr<double>>;
|
|
get f2 => 499 is FutureOr<FutureOr<double>>;
|
|
get f3 => f is FutureOr<FutureOr<double>>;
|
|
get f4 => f_noInline is FutureOr<FutureOr<double>>;
|
|
|
|
test(fromConst, fromFinal, fromImplicitConstant, fromInlined, fromRuntime) {
|
|
Expect.equals(fromRuntime, fromConst);
|
|
Expect.equals(fromRuntime, fromFinal);
|
|
Expect.equals(fromRuntime, fromInlined);
|
|
Expect.equals(fromRuntime, fromImplicitConstant);
|
|
}
|
|
|
|
main() {
|
|
test(b0, b1, b2, b3, b4);
|
|
test(c0, c1, c2, c3, c4);
|
|
test(d0, d1, d2, d3, d4);
|
|
test(e0, e1, e2, e3, e4);
|
|
test(f0, f1, f2, f3, f4);
|
|
} |