Skip to content

Commit c7c4495

Browse files
author
Dart CI
committed
Version 2.13.0-132.0.dev
Merge commit '3c5767ccd34d0aeaf084bbf50b0849e24c17d710' into 'dev'
2 parents 616f110 + 3c5767c commit c7c4495

26 files changed

+254
-203
lines changed

pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,8 @@ class StatementCompletionProcessor {
427427
}
428428
DoStatement statement = node;
429429
var sb = _sourceBuilderAfterKeyword(statement.doKeyword);
430-
// I modified the code and ran the tests with both the old and new parser.
431-
// Apparently the old parser sometimes sticks something other than 'while'
432-
// into the whileKeyword field, which causes statement completion to throw
433-
// an exception further downstream.
434-
// TODO(danrubel): change `statement.whileKeyword?.lexeme == "while"`
435-
// to `statement.whileKeyword != null` once the fasta parser is the default.
436-
var hasWhileKeyword = statement.whileKeyword?.lexeme == 'while' &&
437-
!statement.whileKeyword.isSynthetic;
430+
var hasWhileKeyword =
431+
statement.whileKeyword != null && !statement.whileKeyword.isSynthetic;
438432
var exitDelta = 0;
439433
if (!_statementHasValidBody(statement.doKeyword, statement.body)) {
440434
var text = utils.getNodeText(statement.body);

pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ abstract class _BaseDartCompletionContributorTest extends AbstractContextTest
9696
/// where there is no `new` or `const` keyword.
9797
bool get suggestConstructorsWithoutNew => true;
9898

99-
bool get usingFastaParser => true;
100-
10199
void addTestSource(String content) {
102100
expect(completionOffset, isNull, reason: 'Call addTestUnit exactly once');
103101
completionOffset = content.indexOf('^');

pkg/analysis_server/test/services/completion/dart/keyword_contributor_test.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,7 @@ class KeywordContributorTest extends DartCompletionContributorTest {
528528
Future<void> test_anonymous_function_async7() async {
529529
addTestSource('main() {foo("bar", () as^ => null');
530530
await computeSuggestions();
531-
assertSuggestKeywords([],
532-
pseudoKeywords:
533-
usingFastaParser ? ['async'] : ['async', 'async*', 'sync*']);
531+
assertSuggestKeywords([], pseudoKeywords: ['async']);
534532
}
535533

536534
Future<void> test_anonymous_function_async8() async {
@@ -916,17 +914,13 @@ class KeywordContributorTest extends DartCompletionContributorTest {
916914
Future<void> test_class_implements2() async {
917915
addTestSource('class A e^ implements foo');
918916
await computeSuggestions();
919-
assertSuggestKeywords(usingFastaParser
920-
? [Keyword.EXTENDS]
921-
: [Keyword.EXTENDS, Keyword.IMPLEMENTS]);
917+
assertSuggestKeywords([Keyword.EXTENDS]);
922918
}
923919

924920
Future<void> test_class_implements3() async {
925921
addTestSource('class A e^ implements foo { }');
926922
await computeSuggestions();
927-
assertSuggestKeywords(usingFastaParser
928-
? [Keyword.EXTENDS]
929-
: [Keyword.EXTENDS, Keyword.IMPLEMENTS]);
923+
assertSuggestKeywords([Keyword.EXTENDS]);
930924
}
931925

932926
Future<void> test_class_implements_name() async {

pkg/analysis_server/test/services/completion/statement/statement_completion_test.dart

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,17 +1398,7 @@ main() {
13981398
(s) => _afterLast(s, ' '));
13991399
}
14001400

1401-
@failingTest
14021401
Future<void> test_noCloseParenWithSemicolon() async {
1403-
// TODO(danrubel):
1404-
// Fasta scanner produces an error message which is converted into
1405-
// an Analyzer error message before the fasta parser gets a chance
1406-
// to move it along with the associated synthetic ')' to a more
1407-
// appropriate location. This means that some statement completions,
1408-
// which are expecting errors in a particular location, don't work.
1409-
// Fixing this properly means modifying the scanner not to generate
1410-
// closing ')', then updating the parser to handle that situation.
1411-
// This is a fair amount of work and won't be tackled today.
14121402
var before = '''
14131403
main() {
14141404
var s = 'sample'.substring(3;
@@ -1427,12 +1417,6 @@ main() {
14271417
await _prepareCompletion('ing(3;', before, atEnd: true);
14281418
_assertHasChange('Insert a newline at the end of the current line', after,
14291419
(s) => _afterLast(s, ' '));
1430-
1431-
// The old Analyzer parser passes this test, but will be turned off soon.
1432-
// It is preferable to throw only if the old analyzer is being used,
1433-
// but there does not seem to be a reliable way to determine that here.
1434-
// TODO(danrubel): remove this once fasta parser is enabled by default.
1435-
throw 'remove this once fasta parser is enabled by default';
14361420
}
14371421

14381422
Future<void> test_semicolonFn() async {
@@ -1507,12 +1491,6 @@ main() {
15071491
f() {}
15081492
''',
15091493
(s) => _afterLast(s, ' '));
1510-
1511-
// The old Analyzer parser passes this test, but will be turned off soon.
1512-
// It is preferable to throw only if the old analyzer is being used,
1513-
// but there does not seem to be a reliable way to determine that here.
1514-
// TODO(danrubel): remove this once fasta parser is enabled by default.
1515-
throw 'remove this once fasta parser is enabled by default';
15161494
}
15171495

15181496
Future<void> test_semicolonFnExpr() async {

pkg/compiler/lib/src/elements/types.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ abstract class DartTypeStructuralPredicateVisitor
13811381

13821382
@override
13831383
bool visitNeverType(NeverType type, List<FunctionTypeVariable> bindings) =>
1384-
false;
1384+
handleNeverType(type);
13851385

13861386
@override
13871387
bool visitVoidType(VoidType type, List<FunctionTypeVariable> bindings) =>

pkg/compiler/lib/src/js_backend/impact_transformer.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,17 @@ class CodegenImpactTransformer {
415415
case ConstantValueKind.SET:
416416
case ConstantValueKind.MAP:
417417
case ConstantValueKind.CONSTRUCTED:
418-
case ConstantValueKind.INSTANTIATION:
419418
case ConstantValueKind.LIST:
420419
transformed.registerStaticUse(StaticUse.staticInvoke(
421420
_closedWorld.commonElements.findType, CallStructure.ONE_ARG));
422421
break;
422+
case ConstantValueKind.INSTANTIATION:
423+
transformed.registerStaticUse(StaticUse.staticInvoke(
424+
_closedWorld.commonElements.findType, CallStructure.ONE_ARG));
425+
InstantiationConstantValue instantiation = constantUse.value;
426+
_rtiChecksBuilder.registerGenericInstantiation(GenericInstantiation(
427+
instantiation.function.type, instantiation.typeArguments));
428+
break;
423429
case ConstantValueKind.DEFERRED_GLOBAL:
424430
_closedWorld.outputUnitData
425431
.registerConstantDeferredUse(constantUse.value);

pkg/compiler/lib/src/js_backend/runtime_types.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ class RuntimeTypesImpl
533533
TypeVariableTests typeVariableTests = new TypeVariableTests(
534534
_elementEnvironment,
535535
_commonElements,
536-
_types,
537536
codegenWorld,
538537
_genericInstantiations,
539538
forRtiNeeds: false);

0 commit comments

Comments
 (0)