blob: 10cbb6b81e6ec3ad04675461da2fe26c94101262 [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.
// SharedOptions=--enable-experiment=control-flow-collections,spread-collections,constant-update-2018
import 'package:expect/expect.dart';
void main() {
bool nullBool = null;
Expect.throwsAssertionError(() => <int>[if (nullBool) 1]);
Expect.throwsAssertionError(() => <int, int>{if (nullBool) 1: 1});
Expect.throwsAssertionError(() => <int>{if (nullBool) 1});
}