Skip to content

Commit

Permalink
Version 3.5.0-110.0.dev
Browse files Browse the repository at this point in the history
Merge 9ee25d3 into dev
  • Loading branch information
Dart CI committed Apr 29, 2024
2 parents 9eb838f + 9ee25d3 commit bf1e09a
Show file tree
Hide file tree
Showing 139 changed files with 806 additions and 793 deletions.
13 changes: 2 additions & 11 deletions pkg/dart2native/lib/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Future<void> generateNative({
String? resourcesFile,
String enableExperiment = '',
bool enableAsserts = false,
bool soundNullSafety = true,
bool verbose = false,
String verbosity = 'all',
List<String> extraOptions = const [],
Expand Down Expand Up @@ -122,7 +121,6 @@ Future<void> generateNative({
extraGenKernelOptions: [
'--invocation-modes=compile',
'--verbosity=$verbosity',
'--${soundNullSafety ? '' : 'no-'}sound-null-safety',
],
resourcesFile: resourcesFile,
aot: true,
Expand Down Expand Up @@ -150,7 +148,6 @@ Future<void> generateNative({
extraGenKernelOptions: [
'--invocation-modes=compile',
'--verbosity=$verbosity',
'--${soundNullSafety ? '' : 'no-'}sound-null-safety',
],
nativeAssets: nativeAssets,
aot: true,
Expand All @@ -172,12 +169,8 @@ Future<void> generateNative({
);
}

final extraAotOptions = <String>[
if (!soundNullSafety) '--no-sound-null-safety',
...extraOptions
];
if (verbose) {
print('Generating AOT snapshot. $genSnapshot $extraAotOptions');
print('Generating AOT snapshot. $genSnapshot $extraOptions');
}
final snapshotFile =
kind == Kind.aot ? outputPath : path.join(tempDir.path, 'snapshot.aot');
Expand All @@ -186,7 +179,7 @@ Future<void> generateNative({
snapshotFile,
debugPath,
enableAsserts,
extraAotOptions,
extraOptions,
);

if (verbose || snapshotResult.exitCode != 0) {
Expand Down Expand Up @@ -260,7 +253,6 @@ Future<void> generateKernel({
// What are the implications of using a product mode kernel
// in a non-product runtime?
bool product = true,
bool soundNullSafety = true,
bool verbose = false,
String? nativeAssets,
String? resourcesFile,
Expand All @@ -282,7 +274,6 @@ Future<void> generateKernel({
extraGenKernelOptions: [
'--invocation-modes=compile',
'--verbosity=$verbosity',
'--${soundNullSafety ? '' : 'no-'}sound-null-safety',
],
nativeAssets: nativeAssets,
resourcesFile: resourcesFile,
Expand Down
2 changes: 0 additions & 2 deletions pkg/dartdev/lib/src/commands/compile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ class CompileKernelSnapshotCommand extends CompileSubcommandCommand {
enableExperiment: args.enabledExperiments.join(','),
linkPlatform: args.flag('link-platform'),
embedSources: args.flag('embed-sources'),
soundNullSafety: args.flag('sound-null-safety'),
verbose: verbose,
verbosity: args.option('verbosity')!,
);
Expand Down Expand Up @@ -518,7 +517,6 @@ Remove debugging information from the output and save it separately to the speci
packages: args.option('packages'),
enableExperiment: args.enabledExperiments.join(','),
enableAsserts: args.flag('enable-asserts'),
soundNullSafety: args.flag('sound-null-safety'),
debugFile: args.option('save-debugging-info'),
verbose: verbose,
verbosity: args.option('verbosity')!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static const field core::String var12 = #C5;
static const field core::int var13 = #C2;
static method fn(dynamic error) → core::int {
try {
throw error as{TypeError,Unchecked} core::Object;
throw let dynamic #t1 = error in #t1 == null ?{core::Object} #t1 as{TypeError} core::Object : #t1{core::Object};
}
on core::String catch(no-exception-var) {
return 0;
Expand All @@ -31,7 +31,7 @@ static method fn(dynamic error) → core::int {
}
static method fn1(dynamic error) → core::int {
try {
throw error as{TypeError,Unchecked} core::Object;
throw let dynamic #t2 = error in #t2 == null ?{core::Object} #t2 as{TypeError} core::Object : #t2{core::Object};
}
on core::int catch(final core::int e) {
return e;
Expand All @@ -44,7 +44,7 @@ static method finallyReturn(dynamic error) → core::int {
try
try {
if(!(error =={core::Object::==}{(core::Object) → core::bool} 1))
throw error as{TypeError,Unchecked} core::Object;
throw let dynamic #t3 = error in #t3 == null ?{core::Object} #t3 as{TypeError} core::Object : #t3{core::Object};
}
on core::int catch(final core::int e) {
return e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static method finallyThrow(core::int x) → core::int {
}
static method unhandledThrow(dynamic x) → core::int {
try {
throw x as{TypeError,Unchecked} core::Object;
throw let dynamic #t1 = x in #t1 == null ?{core::Object} #t1 as{TypeError} core::Object : #t1{core::Object};
}
on core::String catch(final core::String e) {
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ static method test() → dynamic {
self::Class c = new self::Class::•();
(core::int, core::int) → core::int f = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/implicit_instantiation_errors.dart:16:30: Error: A value of type 'int Function(int, int)?' can't be assigned to a variable of type 'int Function(int, int)' because 'int Function(int, int)?' is nullable and 'int Function(int, int)' isn't.
int Function(int, int) f = alias;
^" in (let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t1 = self::alias in #t1 == null ?{(core::int, core::int) →? core::int} null : #t1{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int>) as{TypeError,Unchecked} (core::int, core::int) → core::int;
^" in let (core::int, core::int) →? core::int #t1 = let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t2 = self::alias in #t2 == null ?{(core::int, core::int) →? core::int} null : #t2{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int> in #t1 == null ?{(core::int, core::int) → core::int} #t1 as{TypeError} (core::int, core::int) → core::int : #t1{(core::int, core::int) → core::int};
(core::int, core::int?) →? core::int g;
g = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/implicit_instantiation_errors.dart:18:7: Error: A value of type 'int Function(int, int)?' can't be assigned to a variable of type 'int Function(int, int?)?' because 'int?' is nullable and 'int' isn't.
g = alias;
^" in (let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t2 = self::alias in #t2 == null ?{(core::int, core::int) →? core::int} null : #t2{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int>) as{TypeError,Unchecked} (core::int, core::int?) →? core::int;
^" in (let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t3 = self::alias in #t3 == null ?{(core::int, core::int) →? core::int} null : #t3{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int>) as{TypeError} (core::int, core::int?) →? core::int;
(core::int, core::int?) → core::int h = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/implicit_instantiation_errors.dart:19:27: Error: A value of type 'int Function(int, int)' can't be assigned to a variable of type 'int Function(int, int?)' because 'int?' is nullable and 'int' isn't.
int Function(int, int?) h = c;
^" in ((let final self::Class #t3 = c in #t3 == null ?{<T extends core::Object? = dynamic>(T%, core::int) → T%} null : #t3.{self::Class::call}{<T extends core::Object? = dynamic>(T%, core::int) → T%})<core::int>) as{TypeError,Unchecked} (core::int, core::int?) → core::int;
^" in ((let final self::Class #t4 = c in #t4 == null ?{<T extends core::Object? = dynamic>(T%, core::int) → T%} null : #t4.{self::Class::call}{<T extends core::Object? = dynamic>(T%, core::int) → T%})<core::int>) as{TypeError} (core::int, core::int?) → core::int;
g = invalid-expression "pkg/front_end/testcases/constructor_tearoffs/implicit_instantiation_errors.dart:20:3: Error: A value of type 'int Function(int, int)' can't be assigned to a variable of type 'int Function(int, int?)?' because 'int?' is nullable and 'int' isn't.
g = c;
^" in ((let final self::Class #t4 = c in #t4 == null ?{<T extends core::Object? = dynamic>(T%, core::int) → T%} null : #t4.{self::Class::call}{<T extends core::Object? = dynamic>(T%, core::int) → T%})<core::int>) as{TypeError,Unchecked} (core::int, core::int?) →? core::int;
^" in ((let final self::Class #t5 = c in #t5 == null ?{<T extends core::Object? = dynamic>(T%, core::int) → T%} null : #t5.{self::Class::call}{<T extends core::Object? = dynamic>(T%, core::int) → T%})<core::int>) as{TypeError} (core::int, core::int?) →? core::int;
self::method(invalid-expression "pkg/front_end/testcases/constructor_tearoffs/implicit_instantiation_errors.dart:21:10: Error: The argument type 'int Function(int, int)?' can't be assigned to the parameter type 'int Function(int, int?)' because 'int?' is nullable and 'int' isn't.
method(alias);
^" in (let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t5 = self::alias in #t5 == null ?{(core::int, core::int) →? core::int} null : #t5{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int>) as{TypeError,Unchecked} (core::int, core::int?) → core::int);
^" in (let final <T extends core::Object? = dynamic>(T%, core::int) →? T% #t6 = self::alias in #t6 == null ?{(core::int, core::int) →? core::int} null : #t6{<T extends core::Object? = dynamic>(T%, core::int) → T%}<core::int>) as{TypeError} (core::int, core::int?) → core::int);
}
static method main() → dynamic {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class LinkFactory extends core::Object {
return invalid-expression "pkg/front_end/testcases/constructor_tearoffs/lowering/invalid_redirect.dart:14:12: Error: The value 'null' can't be returned from a function with return type 'LinkFactory' because 'LinkFactory' is not nullable.
- 'LinkFactory' is from 'pkg/front_end/testcases/constructor_tearoffs/lowering/invalid_redirect.dart'.
return null;
^" in null as{TypeError,Unchecked} self::LinkFactory;
^" in let Null #t1 = null in #t1 == null ?{self::LinkFactory} #t1 as{TypeError} self::LinkFactory : #t1{self::LinkFactory};
}
static method _#create#tearOff() → self::LinkFactory
return self::LinkFactory::create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,22 +388,22 @@ static method test<T1 extends core::Object? = dynamic, T2 extends self::A, T3 ex
o = invalid-expression "pkg/front_end/testcases/extension_types/assign_interface_type.dart:39:7: Error: A value of type 'C' can't be assigned to a variable of type 'Object' because 'C' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
o = c; // Error
^" in c as{TypeError,Unchecked} core::Object;
^" in let self::C% /* erasure=core::Object?, declared=! */ #t1 = c in #t1 == null ?{core::Object} #t1 as{TypeError} core::Object : #t1{core::Object};
o = d;
o = invalid-expression "pkg/front_end/testcases/extension_types/assign_interface_type.dart:41:7: Error: A value of type 'D2' can't be assigned to a variable of type 'Object' because 'D2' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
o = d2; // Error
^" in d2 as{TypeError,Unchecked} core::Object;
^" in let self::D2% /* erasure=core::Object, declared=! */ #t2 = d2 in #t2 == null ?{core::Object} #t2 as{TypeError} core::Object : #t2{core::Object};
o = e;
o = f;
o = invalid-expression "pkg/front_end/testcases/extension_types/assign_interface_type.dart:44:7: Error: A value of type 'G<T1>' can't be assigned to a variable of type 'Object' because 'G<T1>' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
o = g1; // Error
^" in g1 as{TypeError,Unchecked} core::Object;
^" in let self::G<self::test::T1%>% /* erasure=self::test::T1%, declared=! */ #t3 = g1 in #t3 == null ?{core::Object} #t3 as{TypeError} core::Object : #t3{core::Object};
o = invalid-expression "pkg/front_end/testcases/extension_types/assign_interface_type.dart:45:7: Error: A value of type 'G<T2>' can't be assigned to a variable of type 'Object' because 'G<T2>' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
o = g2; // Error
^" in g2 as{TypeError,Unchecked} core::Object;
^" in let self::G<self::test::T2>% /* erasure=self::test::T2, declared=! */ #t4 = g2 in #t4 == null ?{core::Object} #t4 as{TypeError} core::Object : #t4{core::Object};
o = g3;
a = invalid-expression "pkg/front_end/testcases/extension_types/assign_interface_type.dart:48:7: Error: A value of type 'Object' can't be assigned to a variable of type 'A'.
- 'Object' is from 'dart:core'.
Expand Down
13 changes: 13 additions & 0 deletions pkg/front_end/testcases/extension_types/issue55578.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright (c) 2024, 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.

import 'dart:async';

extension type E(Future<String> it) implements Future<String> {}

foo(FutureOr<String> x) {}

E bar() => throw 0;

test() => foo(bar()); // Ok.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */ {
lowered final self::E /* erasure=asy::Future<core::String> */ #this = it;
return #this;
}
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic {}
static method bar() → self::E /* erasure=asy::Future<core::String> */
return throw 0;
static method test() → dynamic
return self::foo(self::bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */ {
lowered final self::E /* erasure=asy::Future<core::String> */ #this = it;
return #this;
}
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic {}
static method bar() → self::E /* erasure=asy::Future<core::String> */
return throw 0;
static method test() → dynamic
return self::foo(self::bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'dart:async';

extension type E(Future<String> it) implements Future<String> {}

foo(FutureOr<String> x) {}

E bar() => throw 0;

test() => foo(bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'dart:async';

E bar() => throw 0;

extension type E(Future<String> it) implements Future<String> {}

foo(FutureOr<String> x) {}

test() => foo(bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */ {
lowered final self::E /* erasure=asy::Future<core::String> */ #this = it;
return #this;
}
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic {}
static method bar() → self::E /* erasure=asy::Future<core::String> */
return throw 0;
static method test() → dynamic
return self::foo(self::bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */ {
lowered final self::E /* erasure=asy::Future<core::String> */ #this = it;
return #this;
}
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic {}
static method bar() → self::E /* erasure=asy::Future<core::String> */
return throw 0;
static method test() → dynamic
return self::foo(self::bar());
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
;
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic
;
static method bar() → self::E /* erasure=asy::Future<core::String> */
;
static method test() → dynamic
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library;
import self as self;
import "dart:async" as asy;
import "dart:core" as core;

import "dart:async";

extension type E(asy::Future<core::String> it) implements asy::Future<core::String> {
abstract extension-type-member representation-field get it() → asy::Future<core::String>;
constructor • = self::E|constructor#;
constructor tearoff • = self::E|constructor#_#new#tearOff;
}
static extension-type-member method E|constructor#(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */ {
lowered final self::E /* erasure=asy::Future<core::String> */ #this = it;
return #this;
}
static extension-type-member method E|constructor#_#new#tearOff(asy::Future<core::String> it) → self::E /* erasure=asy::Future<core::String> */
return self::E|constructor#(it);
static method foo(FutureOr<core::String>x) → dynamic {}
static method bar() → self::E /* erasure=asy::Future<core::String> */
return throw 0;
static method test() → dynamic
return self::foo(self::bar());
Loading

0 comments on commit bf1e09a

Please sign in to comment.