Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d70fb6e

Browse files
author
Dart CI
committed
Version 2.13.0-45.0.dev
Merge commit '5bcb19125ce52308c565bbe320ae5db4235c182a' into 'dev'
2 parents e27f26e + 5bcb191 commit d70fb6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+399
-558
lines changed

pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Lines changed: 0 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,32 +2391,6 @@ Message _withArgumentsDuplicatedExportInType(String name, Uri uri_, Uri uri2_) {
23912391
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
23922392
}
23932393

2394-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
2395-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
2396-
templateDuplicatedImport =
2397-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
2398-
messageTemplate:
2399-
r"""'#name' is imported from both '#uri' and '#uri2'.""",
2400-
withArguments: _withArgumentsDuplicatedImport);
2401-
2402-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
2403-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
2404-
codeDuplicatedImport =
2405-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
2406-
"DuplicatedImport",
2407-
severity: Severity.ignored);
2408-
2409-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
2410-
Message _withArgumentsDuplicatedImport(String name, Uri uri_, Uri uri2_) {
2411-
if (name.isEmpty) throw 'No name provided';
2412-
name = demangleMixinApplicationName(name);
2413-
String? uri = relativizeUri(uri_);
2414-
String? uri2 = relativizeUri(uri2_);
2415-
return new Message(codeDuplicatedImport,
2416-
message: """'${name}' is imported from both '${uri}' and '${uri2}'.""",
2417-
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
2418-
}
2419-
24202394
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
24212395
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
24222396
templateDuplicatedImportInType =
@@ -3243,33 +3217,6 @@ const MessageCode messageExportAfterPart = const MessageCode("ExportAfterPart",
32433217
message: r"""Export directives must precede part directives.""",
32443218
tip: r"""Try moving the export directives before the part directives.""");
32453219

3246-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
3247-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
3248-
templateExportHidesExport =
3249-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
3250-
messageTemplate:
3251-
r"""Export of '#name' (from '#uri') hides export from '#uri2'.""",
3252-
withArguments: _withArgumentsExportHidesExport);
3253-
3254-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
3255-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
3256-
codeExportHidesExport =
3257-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
3258-
"ExportHidesExport",
3259-
severity: Severity.ignored);
3260-
3261-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
3262-
Message _withArgumentsExportHidesExport(String name, Uri uri_, Uri uri2_) {
3263-
if (name.isEmpty) throw 'No name provided';
3264-
name = demangleMixinApplicationName(name);
3265-
String? uri = relativizeUri(uri_);
3266-
String? uri2 = relativizeUri(uri2_);
3267-
return new Message(codeExportHidesExport,
3268-
message:
3269-
"""Export of '${name}' (from '${uri}') hides export from '${uri2}'.""",
3270-
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
3271-
}
3272-
32733220
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
32743221
const Code<Null> codeExportOptOutFromOptIn = messageExportOptOutFromOptIn;
32753222

@@ -4625,33 +4572,6 @@ const MessageCode messageImportAfterPart = const MessageCode("ImportAfterPart",
46254572
message: r"""Import directives must precede part directives.""",
46264573
tip: r"""Try moving the import directives before the part directives.""");
46274574

4628-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
4629-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>
4630-
templateImportHidesImport =
4631-
const Template<Message Function(String name, Uri uri_, Uri uri2_)>(
4632-
messageTemplate:
4633-
r"""Import of '#name' (from '#uri') hides import from '#uri2'.""",
4634-
withArguments: _withArgumentsImportHidesImport);
4635-
4636-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
4637-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>
4638-
codeImportHidesImport =
4639-
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
4640-
"ImportHidesImport",
4641-
severity: Severity.ignored);
4642-
4643-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
4644-
Message _withArgumentsImportHidesImport(String name, Uri uri_, Uri uri2_) {
4645-
if (name.isEmpty) throw 'No name provided';
4646-
name = demangleMixinApplicationName(name);
4647-
String? uri = relativizeUri(uri_);
4648-
String? uri2 = relativizeUri(uri2_);
4649-
return new Message(codeImportHidesImport,
4650-
message:
4651-
"""Import of '${name}' (from '${uri}') hides import from '${uri2}'.""",
4652-
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
4653-
}
4654-
46554575
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
46564576
const Code<Null> codeIncorrectTypeArgumentVariable =
46574577
messageIncorrectTypeArgumentVariable;
@@ -6254,30 +6174,6 @@ const MessageCode messageListLiteralTooManyTypeArguments = const MessageCode(
62546174
analyzerCodes: <String>["EXPECTED_ONE_LIST_TYPE_ARGUMENTS"],
62556175
message: r"""List literal requires exactly one type argument.""");
62566176

6257-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6258-
const Template<
6259-
Message Function(Uri uri_)> templateLoadLibraryHidesMember = const Template<
6260-
Message Function(Uri uri_)>(
6261-
messageTemplate:
6262-
r"""The library '#uri' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading.""",
6263-
tipTemplate: r"""Try to rename or hide the member.""",
6264-
withArguments: _withArgumentsLoadLibraryHidesMember);
6265-
6266-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6267-
const Code<Message Function(Uri uri_)> codeLoadLibraryHidesMember =
6268-
const Code<Message Function(Uri uri_)>("LoadLibraryHidesMember",
6269-
severity: Severity.ignored);
6270-
6271-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6272-
Message _withArgumentsLoadLibraryHidesMember(Uri uri_) {
6273-
String? uri = relativizeUri(uri_);
6274-
return new Message(codeLoadLibraryHidesMember,
6275-
message:
6276-
"""The library '${uri}' defines a top-level member named 'loadLibrary'. This member is hidden by the special member 'loadLibrary' that the language adds to support deferred loading.""",
6277-
tip: """Try to rename or hide the member.""",
6278-
arguments: {'uri': uri_});
6279-
}
6280-
62816177
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
62826178
const Code<Null> codeLoadLibraryTakesNoArguments =
62836179
messageLoadLibraryTakesNoArguments;
@@ -6288,56 +6184,6 @@ const MessageCode messageLoadLibraryTakesNoArguments = const MessageCode(
62886184
analyzerCodes: <String>["LOAD_LIBRARY_TAKES_NO_ARGUMENTS"],
62896185
message: r"""'loadLibrary' takes no arguments.""");
62906186

6291-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6292-
const Template<Message Function(String name, Uri uri_)>
6293-
templateLocalDefinitionHidesExport =
6294-
const Template<Message Function(String name, Uri uri_)>(
6295-
messageTemplate:
6296-
r"""Local definition of '#name' hides export from '#uri'.""",
6297-
withArguments: _withArgumentsLocalDefinitionHidesExport);
6298-
6299-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6300-
const Code<Message Function(String name, Uri uri_)>
6301-
codeLocalDefinitionHidesExport =
6302-
const Code<Message Function(String name, Uri uri_)>(
6303-
"LocalDefinitionHidesExport",
6304-
severity: Severity.ignored);
6305-
6306-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6307-
Message _withArgumentsLocalDefinitionHidesExport(String name, Uri uri_) {
6308-
if (name.isEmpty) throw 'No name provided';
6309-
name = demangleMixinApplicationName(name);
6310-
String? uri = relativizeUri(uri_);
6311-
return new Message(codeLocalDefinitionHidesExport,
6312-
message: """Local definition of '${name}' hides export from '${uri}'.""",
6313-
arguments: {'name': name, 'uri': uri_});
6314-
}
6315-
6316-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6317-
const Template<Message Function(String name, Uri uri_)>
6318-
templateLocalDefinitionHidesImport =
6319-
const Template<Message Function(String name, Uri uri_)>(
6320-
messageTemplate:
6321-
r"""Local definition of '#name' hides import from '#uri'.""",
6322-
withArguments: _withArgumentsLocalDefinitionHidesImport);
6323-
6324-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6325-
const Code<Message Function(String name, Uri uri_)>
6326-
codeLocalDefinitionHidesImport =
6327-
const Code<Message Function(String name, Uri uri_)>(
6328-
"LocalDefinitionHidesImport",
6329-
severity: Severity.ignored);
6330-
6331-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6332-
Message _withArgumentsLocalDefinitionHidesImport(String name, Uri uri_) {
6333-
if (name.isEmpty) throw 'No name provided';
6334-
name = demangleMixinApplicationName(name);
6335-
String? uri = relativizeUri(uri_);
6336-
return new Message(codeLocalDefinitionHidesImport,
6337-
message: """Local definition of '${name}' hides import from '${uri}'.""",
6338-
arguments: {'name': name, 'uri': uri_});
6339-
}
6340-
63416187
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
63426188
const Code<Null> codeMainNotFunctionDeclaration =
63436189
messageMainNotFunctionDeclaration;
@@ -6509,27 +6355,6 @@ const MessageCode messageMissingExplicitConst = const MessageCode(
65096355
message: r"""Constant expression expected.""",
65106356
tip: r"""Try inserting 'const'.""");
65116357

6512-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6513-
const Template<Message Function(int count)>
6514-
templateMissingExplicitTypeArguments =
6515-
const Template<Message Function(int count)>(
6516-
messageTemplate: r"""No type arguments provided, #count possible.""",
6517-
withArguments: _withArgumentsMissingExplicitTypeArguments);
6518-
6519-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6520-
const Code<Message Function(int count)> codeMissingExplicitTypeArguments =
6521-
const Code<Message Function(int count)>("MissingExplicitTypeArguments",
6522-
severity: Severity.ignored);
6523-
6524-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
6525-
Message _withArgumentsMissingExplicitTypeArguments(int count) {
6526-
// ignore: unnecessary_null_comparison
6527-
if (count == null) throw 'No count provided';
6528-
return new Message(codeMissingExplicitTypeArguments,
6529-
message: """No type arguments provided, ${count} possible.""",
6530-
arguments: {'count': count});
6531-
}
6532-
65336358
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
65346359
const Code<Null> codeMissingExponent = messageMissingExponent;
65356360

pkg/analyzer/lib/error/error.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ const List<ErrorCode> errorCodeValues = [
474474
FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE,
475475
FfiCode.MUST_BE_A_SUBTYPE,
476476
FfiCode.NON_CONSTANT_TYPE_ARGUMENT,
477-
FfiCode.NON_CONSTANT_TYPE_ARGUMENT_WARNING,
478477
FfiCode.NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER,
479478
FfiCode.NON_SIZED_TYPE_ARGUMENT,
480479
FfiCode.SUBTYPE_OF_FFI_CLASS_IN_EXTENDS,

pkg/analyzer/lib/src/dart/error/ffi_code.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,6 @@ class FfiCode extends AnalyzerErrorCode {
183183
"parameters are not constants.",
184184
correction: "Try changing the type argument to be a constant type.");
185185

186-
/**
187-
* Parameters:
188-
* 0: the name of the function, method, or constructor having type arguments
189-
*/
190-
static const FfiCode NON_CONSTANT_TYPE_ARGUMENT_WARNING = FfiCode(
191-
name: 'NON_CONSTANT_TYPE_ARGUMENT_WARNING',
192-
message:
193-
"Support for using non-constant type arguments '{0}' in this FFI API"
194-
" is deprecated and will be removed in the next stable version of "
195-
"Dart. Rewrite the code to ensure that type arguments are compile "
196-
"time constants referring to a valid native type.",
197-
correction: "Try changing the type argument to be a constant type.",
198-
type: ErrorType.HINT);
199-
200186
/**
201187
* Parameters:
202188
* 0: the type that should be a valid dart:ffi native type.

pkg/analyzer/lib/src/generated/ffi_verifier.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,7 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
525525
if (!_isValidFfiNativeType(T, allowVoid: true, allowEmptyStruct: true)) {
526526
final AstNode errorNode = node;
527527
_errorReporter.reportErrorForNode(
528-
FfiCode.NON_CONSTANT_TYPE_ARGUMENT_WARNING,
529-
errorNode,
530-
['elementAt']);
528+
FfiCode.NON_CONSTANT_TYPE_ARGUMENT, errorNode, ['elementAt']);
531529
}
532530
}
533531
}
@@ -703,7 +701,7 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
703701
if (!_isValidFfiNativeType(T, allowVoid: true, allowEmptyStruct: true)) {
704702
final AstNode errorNode = node;
705703
_errorReporter.reportErrorForNode(
706-
FfiCode.NON_CONSTANT_TYPE_ARGUMENT_WARNING, errorNode, ['sizeOf']);
704+
FfiCode.NON_CONSTANT_TYPE_ARGUMENT, errorNode, ['sizeOf']);
707705
}
708706
}
709707

pkg/build_integration/lib/file_system/multi_root.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,17 @@ class MultiRootFileSystemEntity implements FileSystemEntity {
7474
@override
7575
Future<bool> exists() async => (await delegate).exists();
7676

77+
@override
78+
Future<bool> existsAsyncIfPossible() async =>
79+
(await delegate).existsAsyncIfPossible();
80+
7781
@override
7882
Future<List<int>> readAsBytes() async => (await delegate).readAsBytes();
7983

84+
@override
85+
Future<List<int>> readAsBytesAsyncIfPossible() async =>
86+
(await delegate).readAsBytes();
87+
8088
@override
8189
Future<String> readAsString() async => (await delegate).readAsString();
8290
}
@@ -90,10 +98,16 @@ class MissingFileSystemEntity implements FileSystemEntity {
9098
@override
9199
Future<bool> exists() => Future.value(false);
92100

101+
@override
102+
Future<bool> existsAsyncIfPossible() => exists();
103+
93104
@override
94105
Future<List<int>> readAsBytes() =>
95106
Future.error(FileSystemException(uri, 'File not found'));
96107

108+
@override
109+
Future<List<int>> readAsBytesAsyncIfPossible() => readAsBytes();
110+
97111
@override
98112
Future<String> readAsString() =>
99113
Future.error(FileSystemException(uri, 'File not found'));

pkg/build_integration/lib/file_system/single_root.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,17 @@ class SingleRootFileSystemEntity implements FileSystemEntity {
6161
@override
6262
Future<bool> exists() async => delegate.exists();
6363

64+
@override
65+
Future<bool> existsAsyncIfPossible() async =>
66+
delegate.existsAsyncIfPossible();
67+
6468
@override
6569
Future<List<int>> readAsBytes() async => delegate.readAsBytes();
6670

71+
@override
72+
Future<List<int>> readAsBytesAsyncIfPossible() async =>
73+
delegate.readAsBytesAsyncIfPossible();
74+
6775
@override
6876
Future<String> readAsString() async => delegate.readAsString();
6977
}

pkg/compiler/lib/src/kernel/front_end_adapter.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class _CompilerFileSystemEntity implements fe.FileSystemEntity {
6868
return input.data;
6969
}
7070

71+
@override
72+
Future<List<int>> readAsBytesAsyncIfPossible() => readAsBytes();
73+
7174
@override
7275
Future<bool> exists() async {
7376
try {
@@ -78,6 +81,9 @@ class _CompilerFileSystemEntity implements fe.FileSystemEntity {
7881
return false;
7982
}
8083
}
84+
85+
@override
86+
Future<bool> existsAsyncIfPossible() => exists();
8187
}
8288

8389
/// Report a [message] received from the front-end, using dart2js's

pkg/front_end/lib/src/api_prototype/file_system.dart

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,49 @@ abstract class FileSystemEntity {
3838
Uri get uri;
3939

4040
/// Whether this file system entity exists.
41+
///
42+
/// This method cannot be assumed to do any async work, in fact, if possible
43+
/// it should perform the check sync as that might be faster depending on the
44+
/// caller. If wanting to check async - for instance if trying to physically
45+
/// check for existence and read in parallel - use [existsAsyncIfPossible]
46+
/// instead.
4147
Future<bool> exists();
4248

49+
/// Whether this file system entity exists.
50+
///
51+
/// This method cannot be assumed to do any async work, but should - if
52+
/// possible - in fact do async work as that might be faster depending on the
53+
/// caller - for instance if trying to physically check for existence (and
54+
/// read) in parallel.
55+
/// For sequential checks one should use [exists] instead.
56+
Future<bool> existsAsyncIfPossible();
57+
4358
/// Attempts to access this file system entity as a file and read its contents
4459
/// as raw bytes.
4560
///
61+
/// This method cannot be assumed to do any async work, in fact, if possible
62+
/// it should the read sync as that might be faster depending on the caller.
63+
/// If wanting to read async - for instance if trying to physically read in
64+
/// parallel - use [readAsBytesAsyncIfPossible] instead.
65+
///
4666
/// If an error occurs while attempting to read the file (e.g. because no such
4767
/// file exists, or the entity is a directory), the future is completed with
4868
/// [FileSystemException].
4969
Future<List<int>> readAsBytes();
5070

71+
/// Attempts to access this file system entity as a file and read its contents
72+
/// as raw bytes.
73+
///
74+
/// This method cannot be assumed to do any async work, but should - if
75+
/// possible - in fact do async work as that might be faster depending on the
76+
/// caller - for instance if trying to physically read in parallel.
77+
/// For sequential reads one should use [readAsBytes] instead.
78+
///
79+
/// If an error occurs while attempting to read the file (e.g. because no such
80+
/// file exists, or the entity is a directory), the future is completed with
81+
/// [FileSystemException].
82+
Future<List<int>> readAsBytesAsyncIfPossible();
83+
5184
/// Attempts to access this file system entity as a file and read its contents
5285
/// as a string.
5386
///

0 commit comments

Comments
 (0)