blob: f3645f26cd433318cd56d2fb38787b567d5ef437 [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
void main() {
// If cannot be used in a const collection.
const _ = [if (true) 1]; //# 00: compile-time error
const _ = [if (false) 1 else 2]; //# 01: compile-time error
const _ = {if (true) 1}; //# 02: compile-time error
const _ = {if (false) 1 else 2}; //# 03: compile-time error
const _ = {if (true) 1: 1}; //# 04: compile-time error
const _ = {if (false) 1: 1 else 2: 2}; //# 05: compile-time error
}