Skip to content

Commit

Permalink
Version 2.19.0-133.0.dev
Browse files Browse the repository at this point in the history
Merge commit '104b0deb5c36f48a39fe70c656c0aa48ecd88607' into 'dev'
  • Loading branch information
Dart CI committed Aug 24, 2022
2 parents 539f256 + 104b0de commit 859e9bb
Show file tree
Hide file tree
Showing 41 changed files with 1,718 additions and 71 deletions.
53 changes: 53 additions & 0 deletions pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2753,6 +2753,59 @@ Message _withArgumentsDuplicatedParameterNameCause(String name) {
arguments: {'name': name});
}

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
String
name)> templateDuplicatedRecordTypeFieldName = const Template<
Message Function(String name)>(
problemMessageTemplate: r"""Duplicated record type field name '#name'.""",
correctionMessageTemplate:
r"""Try renaming or removing one of the named record type fields.""",
withArguments: _withArgumentsDuplicatedRecordTypeFieldName);

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeDuplicatedRecordTypeFieldName =
const Code<Message Function(String name)>(
"DuplicatedRecordTypeFieldName",
);

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsDuplicatedRecordTypeFieldName(String name) {
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
return new Message(codeDuplicatedRecordTypeFieldName,
problemMessage: """Duplicated record type field name '${name}'.""",
correctionMessage:
"""Try renaming or removing one of the named record type fields.""",
arguments: {'name': name});
}

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String name)>
templateDuplicatedRecordTypeFieldNameContext =
const Template<Message Function(String name)>(
problemMessageTemplate:
r"""This is the existing record type field named '#name'.""",
withArguments: _withArgumentsDuplicatedRecordTypeFieldNameContext);

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)>
codeDuplicatedRecordTypeFieldNameContext =
const Code<Message Function(String name)>(
"DuplicatedRecordTypeFieldNameContext",
severity: Severity.context);

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsDuplicatedRecordTypeFieldNameContext(String name) {
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
return new Message(codeDuplicatedRecordTypeFieldNameContext,
problemMessage:
"""This is the existing record type field named '${name}'.""",
arguments: {'name': name});
}

// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeEmptyNamedParameterList = messageEmptyNamedParameterList;

Expand Down
1 change: 1 addition & 0 deletions pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ enum NullValue {
OperatorList,
ParameterDefaultValue,
Prefix,
RecordTypeFieldList,
ShowClause,
StringLiteral,
SwitchScope,
Expand Down
85 changes: 85 additions & 0 deletions pkg/front_end/lib/src/fasta/builder/invalid_type_builder.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// Copyright (c) 2022, 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 'package:front_end/src/fasta/builder/library_builder.dart';

import 'package:front_end/src/fasta/builder/named_type_builder.dart';

import 'package:front_end/src/fasta/builder/nullability_builder.dart';

import 'package:front_end/src/fasta/source/source_library_builder.dart';

import 'package:kernel/ast.dart';

import 'package:kernel/class_hierarchy.dart';

import 'type_builder.dart';

/// Type builder for invalid types as a type builder.
///
/// This builder results in the creation of an [InvalidType] and can only be
/// used when an error has already been reported.
class InvalidTypeBuilder extends TypeBuilder {
@override
final Uri fileUri;

@override
final int charOffset;

InvalidTypeBuilder(this.fileUri, this.charOffset);

@override
DartType build(LibraryBuilder library, TypeUse typeUse,
{ClassHierarchyBase? hierarchy}) {
return const InvalidType();
}

@override
DartType buildAliased(
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
return const InvalidType();
}

@override
Supertype? buildMixedInType(LibraryBuilder library) {
return null;
}

@override
Supertype? buildSupertype(LibraryBuilder library) {
return null;
}

@override
TypeBuilder clone(
List<NamedTypeBuilder> newTypes,
SourceLibraryBuilder contextLibrary,
TypeParameterScopeBuilder contextDeclaration) {
return this;
}

@override
String get debugName => 'InvalidTypeBuilder';

@override
bool get isExplicit => true;

@override
bool get isVoidType => false;

@override
Object? get name => null;

@override
NullabilityBuilder get nullabilityBuilder =>
const NullabilityBuilder.inherent();

@override
StringBuffer printOn(StringBuffer buffer) => buffer;

@override
TypeBuilder withNullabilityBuilder(NullabilityBuilder nullabilityBuilder) {
return this;
}
}
Loading

0 comments on commit 859e9bb

Please sign in to comment.