blob: b060c1fdb576dcccc889080c1392ff3ff05f470a [file] [log] [blame]
// Copyright (c) 2015, 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.
// Regression test for
// Fails when compiling with --checked.
var a = [];
void doStuff() {
if (a.length) {
// This triggers a TypeConversion to bool in checked mode.
var element = a[0]; // This triggers a bounds check but a.length will have
a.remove(element); // type [empty].
main() {
try {
doStuff(); // This is expected to fail but not crash the compiler.
} catch (_) {}