blob: 45943ffdb0a4a8983c2ea4c0e5752d7f55f32a99 [file] [log] [blame]
// 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.
// @dart=2.9
import 'dart:math';
import 'package:expect/expect.dart';
final bool alwaysFalse = int.parse('1') == 2;
class A {
@pragma("vm:never-inline")
void bar(/* unboxed */ int x) => Expect.isTrue(x.isOdd);
}
class B {
@pragma("vm:never-inline")
void bar(/* boxed */ int x) => Expect.isTrue(x.isOdd);
}
class C extends A implements B {}
main() {
final Random r = Random();
if (alwaysFalse) {
A().bar(r.nextInt(10));
B().bar(r.nextInt(10));
B().bar(null);
}
final List<B> l = [B(), C()];
for (B b in l) {
b.bar(13);
}
}