forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '104b0deb5c36f48a39fe70c656c0aa48ecd88607' into 'dev'
- Loading branch information
Showing
41 changed files
with
1,718 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
pkg/front_end/lib/src/fasta/builder/invalid_type_builder.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.