Skip to content

Commit 86242db

Browse files
author
Dart CI
committed
Version 2.11.0-240.0.dev
Merge commit 'f990e70930fb8b407f5ce80d883f2a3915aa90f8' into 'dev'
2 parents 8af2934 + f990e70 commit 86242db

File tree

35 files changed

+1529
-121
lines changed

35 files changed

+1529
-121
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
const null0 = /*cfe.Null()*/ null;
8+
const bool0 = /*cfe.Bool(true)*/ true;
9+
const bool1 = /*cfe.Bool(false)*/ false;
10+
const string0 = /*cfe.String(foo)*/ 'foo';
11+
const int0 = /*cfe.Int(0)*/ 0;
12+
const double0 = /*cfe.Double(0.5)*/ 0.5;
13+
const symbol0 = /*cfe.Symbol(foo)*/ #foo;
14+
const symbol1 = const /*cfe.Symbol(foo)*/ Symbol('foo');
15+
16+
main() {
17+
print(/*Null()*/ null0);
18+
print(/*Bool(true)*/ bool0);
19+
print(/*Bool(false)*/ bool1);
20+
print(/*String(foo)*/ string0);
21+
print(/*Int(0)*/ int0);
22+
print(/*Double(0.5)*/ double0);
23+
print(
24+
/*cfe|analyzer.Symbol(foo)*/
25+
/*dart2js.Instance(Symbol,{_name:String(foo))*/
26+
symbol0);
27+
print(
28+
/*cfe|analyzer.Symbol(foo)*/
29+
/*dart2js.Instance(Symbol,{_name:String(foo))*/
30+
symbol1);
31+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
String method() => 'foo';
8+
9+
const String string0 =
10+
/*cfe|dart2js.error: Method invocation is not a constant expression.*/
11+
method();
12+
13+
main() {
14+
print(string0);
15+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
T method1<T>(T t) => t;
8+
Map<T, S> method2<T, S>(T t, S s) => {t: s};
9+
10+
const function0 = /*cfe.Function(method1)*/ method1;
11+
12+
const int Function(int) instantiation0 =
13+
/*cfe.Instantiation(method1<int>)*/ method1;
14+
15+
const Map<String, int> Function(String, int) instantiation1 =
16+
/*cfe.Instantiation(method2<String,int>)*/ method2;
17+
18+
main() {
19+
print(
20+
/*cfe|dart2js.Function(method1)*/
21+
/*analyzer.Function(method1,type=T* Function<T>(T*)*)*/
22+
function0);
23+
print(
24+
/*cfe.Instantiation(method1<int>)*/
25+
/*dart2js.Instantiation(method1<int*>)*/
26+
/*analyzer.Function(method1,type=int* Function(int*)*)*/
27+
instantiation0);
28+
print(
29+
/*cfe.Instantiation(method2<String,int>)*/
30+
/*dart2js.Instantiation(method2<String*,int*>)*/
31+
/*analyzer.Function(method2,type=Map<String*, int*>* Function(String*, int*)*)*/
32+
instantiation1);
33+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
const list0 = /*cfe.List<dynamic>()*/ [];
8+
9+
// TODO(johnniwinther): This seems like an odd offset for the constant. It
10+
// should probably be at the start of the type arguments.
11+
const list1 = <int> /*cfe.List<int>()*/ [];
12+
13+
const List<int> list2 = /*cfe.List<int>()*/ [];
14+
15+
const list3 = /*cfe.List<int>(Int(42))*/ [42];
16+
17+
const list4 = /*cfe.List<int>(Int(42),Int(87))*/ [42, 87];
18+
19+
main() {
20+
print(/*analyzer.List<dynamic>*()*/ /*cfe|dart2js.List<dynamic>()*/ list0);
21+
print(
22+
/*analyzer.List<int*>*()*/ /*cfe.List<int>()*/ /*dart2js.List<int*>()*/ list1);
23+
print(
24+
/*analyzer.List<int*>*()*/ /*cfe.List<int>()*/ /*dart2js.List<int*>()*/ list2);
25+
print(
26+
/*analyzer.List<int*>*(Int(42))*/ /*cfe.List<int>(Int(42))*/ /*dart2js.List<int*>(Int(42))*/ list3);
27+
print(
28+
/*analyzer.List<int*>*(Int(42),Int(87))*/ /*cfe.List<int>(Int(42),Int(87))*/ /*dart2js.List<int*>(Int(42),Int(87))*/ list4);
29+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
const map0 = /*cfe.Map<dynamic,dynamic>()*/ {};
8+
9+
// TODO(johnniwinther): This seems like an odd offset for the constant. It
10+
// should probably be at the start of the type arguments.
11+
const map1 = <String, int> /*cfe.Map<String,int>()*/ {};
12+
13+
const Map<String, int> map2 = /*cfe.Map<String,int>()*/ {};
14+
15+
const map3 = /*cfe.Map<String,int>(String(foo):Int(42))*/ {'foo': 42};
16+
17+
const map4 = /*cfe.Map<String,int>(String(foo):Int(42),String(bar):Int(87))*/
18+
{'foo': 42, 'bar': 87};
19+
20+
main() {
21+
print(
22+
/*analyzer.Map<dynamic, dynamic>*()*/ /*cfe|dart2js.Map<dynamic,dynamic>()*/ map0);
23+
print(
24+
/*analyzer.Map<String*, int*>*()*/ /*cfe.Map<String,int>()*/ /*dart2js.Map<String*,int*>()*/ map1);
25+
print(
26+
/*analyzer.Map<String*, int*>*()*/ /*cfe.Map<String,int>()*/ /*dart2js.Map<String*,int*>()*/ map2);
27+
print(
28+
/*analyzer.Map<String*, int*>*(String(foo):Int(42))*/ /*cfe.Map<String,int>(String(foo):Int(42))*/ /*dart2js.Map<String*,int*>(String(foo):Int(42))*/ map3);
29+
print(
30+
/*analyzer.Map<String*, int*>*(String(foo):Int(42),String(bar):Int(87))*/ /*cfe.Map<String,int>(String(foo):Int(42),String(bar):Int(87))*/ /*dart2js.Map<String*,int*>(String(foo):Int(42),String(bar):Int(87))*/ map4);
31+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cfe=pkg/front_end/test/id_tests/constant_test.dart
2+
analyzer=pkg/analyzer/test/id_tests/constant_test.dart
3+
dart2js=pkg/compiler/test/model/cfe_constant_test.dart
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
// ignore: sdk_version_set_literal
8+
const Set set0 = /*cfe.Set<dynamic>()*/ {};
9+
10+
// TODO(johnniwinther): This seems like an odd offset for the constant. It
11+
// should probably be at the start of the type arguments.
12+
// ignore: sdk_version_set_literal
13+
const set1 = <int> /*cfe.Set<int>()*/ {};
14+
15+
// ignore: sdk_version_set_literal
16+
const Set<int> set2 = /*cfe.Set<int>()*/ {};
17+
18+
// ignore: sdk_version_set_literal
19+
const set3 = /*cfe.Set<int>(Int(42))*/ {42};
20+
21+
// ignore: sdk_version_set_literal
22+
const set4 = /*cfe.Set<int>(Int(42),Int(87))*/ {42, 87};
23+
24+
main() {
25+
print(/*analyzer.Set<dynamic>*()*/ /*cfe|dart2js.Set<dynamic>()*/ set0);
26+
print(
27+
/*analyzer.Set<int*>*()*/ /*cfe.Set<int>()*/ /*dart2js.Set<int*>()*/ set1);
28+
print(
29+
/*analyzer.Set<int*>*()*/ /*cfe.Set<int>()*/ /*dart2js.Set<int*>()*/ set2);
30+
print(
31+
/*analyzer.Set<int*>*(Int(42))*/ /*cfe.Set<int>(Int(42))*/ /*dart2js.Set<int*>(Int(42))*/ set3);
32+
print(
33+
/*analyzer.Set<int*>*(Int(42),Int(87))*/ /*cfe.Set<int>(Int(42),Int(87))*/ /*dart2js.Set<int*>(Int(42),Int(87))*/ set4);
34+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
// @dart = 2.7
6+
7+
import 'dart:async';
8+
9+
typedef Typedef();
10+
typedef GenericTypedef<T> = void Function(T);
11+
typedef GenericFunctionTypedef = void Function<T>(T);
12+
typedef TypedefWithFutureOr = void Function<T>(FutureOr<T>);
13+
14+
const typedef = /*cfe.TypeLiteral(dynamic Function())*/ Typedef;
15+
const genericTypedef =
16+
/*cfe.TypeLiteral(void Function(dynamic))*/ GenericTypedef;
17+
const genericFunctionTypedef =
18+
/*cfe.TypeLiteral(void Function<T>(T))*/ GenericFunctionTypedef;
19+
const typedefWithFutureOr =
20+
/*cfe.TypeLiteral(void Function<T>(FutureOr<T>))*/ TypedefWithFutureOr;
21+
const futureOr = /*cfe.TypeLiteral(FutureOr<dynamic>)*/ FutureOr;
22+
const null_ = /*cfe.TypeLiteral(Null)*/ Null;
23+
24+
main() {
25+
print(
26+
/*analyzer.TypeLiteral(dynamic Function()*)*/
27+
/*cfe.TypeLiteral(dynamic Function())*/
28+
/*dart2js.TypeLiteral(()->dynamic)*/
29+
typedef);
30+
31+
print(
32+
/*analyzer.TypeLiteral(void Function(dynamic)*)*/
33+
/*cfe.TypeLiteral(void Function(dynamic))*/
34+
/*dart2js.TypeLiteral((dynamic)->void)*/
35+
genericTypedef);
36+
37+
print(
38+
/*analyzer.TypeLiteral(void Function<T>(T*)*)*/
39+
/*cfe.TypeLiteral(void Function<T>(T))*/
40+
/*dart2js.TypeLiteral((0)->void)*/
41+
genericFunctionTypedef);
42+
43+
print(
44+
/*analyzer.TypeLiteral(void Function<T>(FutureOr<T*>*)*)*/
45+
/*cfe.TypeLiteral(void Function<T>(FutureOr<T>))*/
46+
/*dart2js.TypeLiteral((FutureOr<0>)->void)*/
47+
typedefWithFutureOr);
48+
49+
print(
50+
/*analyzer.TypeLiteral(FutureOr<dynamic>*)*/
51+
/*cfe.TypeLiteral(FutureOr<dynamic>)*/
52+
/*dart2js.TypeLiteral(dynamic)*/
53+
futureOr);
54+
55+
print(
56+
/*analyzer.TypeLiteral(Null*)*/
57+
/*cfe|dart2js.TypeLiteral(Null)*/
58+
null_);
59+
}

pkg/compiler/test/codegen/codegen_test_helper.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:io';
88
import 'package:async_helper/async_helper.dart';
99
import 'package:compiler/src/closure.dart';
1010
import 'package:compiler/src/common.dart';
11+
import 'package:compiler/src/commandline_options.dart';
1112
import 'package:compiler/src/compiler.dart';
1213
import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
1314
import 'package:compiler/src/elements/entities.dart';
@@ -32,7 +33,7 @@ runTests(List<String> args, [int shardIndex]) {
3233
shards: 2,
3334
directory: 'data',
3435
skip: skip,
35-
options: ['--enable-experiment=non-nullable']);
36+
options: ['--enable-experiment=non-nullable', Flags.soundNullSafety]);
3637
}
3738

3839
runTests2(List<String> args, [int shardIndex]) {

pkg/compiler/test/deferred_loading/data/regress_35311/lib.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart = 2.7
6+
57
/*class: B:
68
class_unit=1{lib},
79
type_unit=main{}

0 commit comments

Comments
 (0)