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

Commit 31ddf66

Browse files
author
Dart CI
committed
Version 2.17.0-7.0.dev
Merge commit '423055d5267c9a1e7b449e2f6da56715d0d42338' into 'dev'
2 parents d4e388e + 423055d commit 31ddf66

39 files changed

+557
-131
lines changed

.dart_tool/package_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2022-01-11T09:53:34.372475",
14+
"generated": "2022-01-12T18:31:13.380991",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -784,7 +784,7 @@
784784
"name": "watcher",
785785
"rootUri": "../third_party/pkg/watcher",
786786
"packageUri": "lib/",
787-
"languageVersion": "2.12"
787+
"languageVersion": "2.14"
788788
},
789789
{
790790
"name": "web_components",

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ vars = {
167167
"typed_data_rev": "29ce5a92b03326d0b8035916ac04f528874994bd",
168168
"usage_rev": "f0cb8f7cce8b675255c81488dbab8cf9f2f56404",
169169
"vector_math_rev": "0c9f5d68c047813a6dcdeb88ba7a42daddf25025",
170-
"watcher_rev": "3924194385fb215cef483193ed2879a618a3d69c",
170+
"watcher_rev": "f76997ab0c857dc5537ac0975a9ada92b54ef949",
171171
"webdriver_rev": "ff5ccb1522edf4bed578ead4d65e0cbc1f2c4f02",
172172
"web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
173173
"web_socket_channel_rev": "6448ce532445a8a458fa191d9346df071ae0acad",

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5141,26 +5141,6 @@ Message _withArgumentsIncrementalCompilerIllegalTypeParameter(String string) {
51415141
arguments: {'string': string});
51425142
}
51435143

5144-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
5145-
const Template<Message Function(Uri uri_)> templateInferredPackageUri =
5146-
const Template<Message Function(Uri uri_)>(
5147-
problemMessageTemplate:
5148-
r"""Interpreting this as package URI, '#uri'.""",
5149-
withArguments: _withArgumentsInferredPackageUri);
5150-
5151-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
5152-
const Code<Message Function(Uri uri_)> codeInferredPackageUri =
5153-
const Code<Message Function(Uri uri_)>("InferredPackageUri",
5154-
severity: Severity.warning);
5155-
5156-
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
5157-
Message _withArgumentsInferredPackageUri(Uri uri_) {
5158-
String? uri = relativizeUri(uri_);
5159-
return new Message(codeInferredPackageUri,
5160-
problemMessage: """Interpreting this as package URI, '${uri}'.""",
5161-
arguments: {'uri': uri_});
5162-
}
5163-
51645144
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
51655145
const Code<Null> codeInheritedMembersConflict = messageInheritedMembersConflict;
51665146

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ class UseResultVerifier {
149149
return parent.target == node;
150150
}
151151

152+
if (parent is PrefixedIdentifier) {
153+
if (parent.prefix == node) {
154+
return true;
155+
} else {
156+
return _isUsed(parent);
157+
}
158+
}
159+
152160
if (parent is ParenthesizedExpression ||
153161
parent is ConditionalExpression ||
154162
parent is AwaitExpression) {

pkg/analyzer/test/src/diagnostics/unused_result_test.dart

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,62 @@ void main() {
363363
]);
364364
}
365365

366+
test_getter_expressionStatement_id_dotResult_dotId() async {
367+
await assertNoErrorsInCode(r'''
368+
import 'package:meta/meta.dart';
369+
370+
class A {
371+
@useResult
372+
int get foo => 0;
373+
}
374+
375+
void f(A a) {
376+
a.foo.isEven;
377+
}
378+
''');
379+
}
380+
381+
test_getter_expressionStatement_result() async {
382+
await assertErrorsInCode(r'''
383+
import 'package:meta/meta.dart';
384+
385+
@useResult
386+
int get foo => 0;
387+
388+
void f() {
389+
foo;
390+
}
391+
''', [
392+
error(HintCode.UNUSED_RESULT, 77, 3),
393+
]);
394+
}
395+
396+
test_getter_expressionStatement_result_dotId() async {
397+
await assertNoErrorsInCode(r'''
398+
import 'package:meta/meta.dart';
399+
400+
@useResult
401+
int get foo => 0;
402+
403+
void f() {
404+
foo.isEven;
405+
}
406+
''');
407+
}
408+
409+
test_getter_expressionStatement_result_dotId_dotId() async {
410+
await assertNoErrorsInCode(r'''
411+
import 'package:meta/meta.dart';
412+
413+
@useResult
414+
int get foo => 0;
415+
416+
void f() {
417+
foo.isEven.hashCode;
418+
}
419+
''');
420+
}
421+
366422
test_getter_result_passed() async {
367423
await assertNoErrorsInCode(r'''
368424
import 'package:meta/meta.dart';

pkg/dds_service_extensions/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2020, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkg/front_end/lib/src/fasta/kernel/kernel_target.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import '../messages.dart'
5858
templateFieldNonNullableWithoutInitializerError,
5959
templateFinalFieldNotInitialized,
6060
templateFinalFieldNotInitializedByConstructor,
61-
templateInferredPackageUri,
6261
templateMissingImplementationCause,
6362
templateSuperclassHasNoDefaultConstructor;
6463
import '../problems.dart' show unhandled;
@@ -345,13 +344,6 @@ class KernelTarget extends TargetImplementation {
345344
Uri reversed = Uri.parse(
346345
"package:$packageName/${asString.substring(prefix.length)}");
347346
if (entryPoint == uriTranslator.translate(reversed)) {
348-
if (issueProblem) {
349-
loader.addProblem(
350-
templateInferredPackageUri.withArguments(reversed),
351-
-1,
352-
1,
353-
entryPoint);
354-
}
355347
entryPoint = reversed;
356348
break;
357349
}

pkg/front_end/messages.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4464,16 +4464,6 @@ SuperBoundedHint:
44644464
problemMessage: "If you want '#type' to be a super-bounded type, note that the inverted type '#type2' must then satisfy its bounds, which it does not."
44654465
severity: CONTEXT
44664466

4467-
InferredPackageUri:
4468-
problemMessage: "Interpreting this as package URI, '#uri'."
4469-
severity: WARNING
4470-
frontendInternal: true
4471-
script:
4472-
"main.dart": |
4473-
main() {}
4474-
".packages": |
4475-
example:./
4476-
44774467
MixinApplicationIncompatibleSupertype:
44784468
problemMessage: "'#type' doesn't implement '#type2' so it can't be used with '#type3'."
44794469
analyzerCode: MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE

pkg/front_end/test/incremental_suite.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ Future<Map<String, List<int>>> createModules(
349349
options.sdkSummary = sdkSummaryUri;
350350
options.omitPlatform = true;
351351
options.onDiagnostic = (DiagnosticMessage message) {
352-
if (getMessageCodeObject(message)?.name == "InferredPackageUri") return;
353352
throw message.ansiFormatted;
354353
};
355354
if (packagesUri != null) {

pkg/front_end/test/outline_extractor_suite.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class CompileAndCompareStep
150150
await extractOutline([description.uri], packages: packages);
151151

152152
void onDiagnostic(DiagnosticMessage message) {
153-
if (message.codeName == "InferredPackageUri") return;
154153
if (message.severity == Severity.error ||
155154
message.severity == Severity.warning) {
156155
throw ("Unexpected error: ${message.plainTextFormatted.join('\n')}");

0 commit comments

Comments
 (0)