<commit_before>/*
 * Copyright (c) 2018, 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.
 */
/**
 * @assertion Let the element type of a list literal be the static type of the
 * type argument used to create the list. So <int>[] has an element type of int.
 * It may be explicit or filled in by type inference. So [1, 2.0] has an element
 * type of num.
 *
 * @description Checks that element type of the list literals is the static type
 * of the type argument used to create the list
 * @author <EMAIL>
 */
// SharedOptions=--enable-experiment=control-flow-collections

main() {
  bool b = true;
  var collection = [3, 1.0, 4, 1, 5];

  List<int> list = [if (b) 1.0];                      //# 01: compile-time error
  List<int> list = [if (!b) 1.0,];                    //# 02: compile-time error
  List<int> list = [if (b) for (var v in collection) if (v > 3) v,]; //# 03: compile-time error
  List<int> list = [if (!b) for (var v in collection) if (v > 3) v]; //# 04: compile-time error

  List list = <int>[if (b) 1.0];                      //# 05: compile-time error
  List list = <int>[if (!b) 1.0,];                    //# 06: compile-time error
  List list = <int>[if (b) for (var v in collection) if (v > 3) v,]; //# 07: compile-time error
  List list = <int>[if (!b) for (var v in collection) if (v > 3) v]; //# 08: compile-time error

  const list = <int>[if (1 > 2) 1.0];                 //# 09: compile-time error
  const list = <int>[if (2 > 1) 1.0,];                //# 10: compile-time error

  var list = const <int>[if (1 > 2) 1.0];             //# 11: compile-time error
  var list = const <int>[if (2 > 1) 1.0,];            //# 12: compile-time error
}<commit_msg>Fixes #310. Wrong collection type fixed<commit_after>/*
 * Copyright (c) 2018, 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.
 */
/**
 * @assertion Let the element type of a list literal be the static type of the
 * type argument used to create the list. So <int>[] has an element type of int.
 * It may be explicit or filled in by type inference. So [1, 2.0] has an element
 * type of num.
 *
 * @description Checks that element type of the list literals is the static type
 * of the type argument used to create the list
 * @author <EMAIL>
 */
// SharedOptions=--enable-experiment=control-flow-collections

main() {
  bool b = true;
  var collection = <double>[3, 1.0, 4, 1, 5];

  List<int> list = [if (b) 1.0];                      //# 01: compile-time error
  List<int> list = [if (!b) 1.0,];                    //# 02: compile-time error
  List<int> list = [if (b) for (var v in collection) if (v > 3) v,]; //# 03: compile-time error
  List<int> list = [if (!b) for (var v in collection) if (v > 3) v]; //# 04: compile-time error

  List list = <int>[if (b) 1.0];                      //# 05: compile-time error
  List list = <int>[if (!b) 1.0,];                    //# 06: compile-time error
  List list = <int>[if (b) for (var v in collection) if (v > 3) v,]; //# 07: compile-time error
  List list = <int>[if (!b) for (var v in collection) if (v > 3) v]; //# 08: compile-time error

  const list = <int>[if (1 > 2) 1.0];                 //# 09: compile-time error
  const list = <int>[if (2 > 1) 1.0,];                //# 10: compile-time error

  var list = const <int>[if (1 > 2) 1.0];             //# 11: compile-time error
  var list = const <int>[if (2 > 1) 1.0,];            //# 12: compile-time error
}
{'fraction_non_alphanumeric': 0.14726583649160802, 'fraction_numerical': 0.03600433134813211, 'mean_word_length': 2.319856244384546, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2405942', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1183, 'n_words': 517}