Skip to content

Commit f8ef60a

Browse files
chloestefantsovaCommit Bot
authored and
Commit Bot
committed
Revert "Reland "[cfe,corelib] Add class 'Record' to the core library""
This reverts commit 4b6a8f3. Reason for revert: Breakages in google3. Original change's description: > Reland "[cfe,corelib] Add class 'Record' to the core library" > > Part of #49713 > > Change-Id: I56bfca49492d14bb561b32993fd9adfe775b7400 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259583 > Reviewed-by: Johnni Winther <[email protected]> > Reviewed-by: Slava Egorov <[email protected]> > Commit-Queue: Chloe Stefantsova <[email protected]> # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I61c4db244329615d7d218484cd86601b1c737ba6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259800 Reviewed-by: Slava Egorov <[email protected]> Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Chloe Stefantsova <[email protected]> Auto-Submit: Chloe Stefantsova <[email protected]>
1 parent f83c6d5 commit f8ef60a

File tree

73 files changed

+24
-4532
lines changed

Some content is hidden

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

73 files changed

+24
-4532
lines changed

pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_in/core.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,3 @@ class Type {}
7878

7979
/*class: Invocation:Invocation,Object*/
8080
class Invocation {}
81-
82-
/*cfe|cfe:builder.class: Record:Object,Record*/
83-
/*analyzer.class: Record:Record,Object*/
84-
class Record {}

pkg/_fe_analyzer_shared/test/inheritance/data/object_opt_out/core.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,3 @@ class Type {}
8383

8484
/*class: Invocation:Invocation,Object*/
8585
class Invocation {}
86-
87-
/*analyzer.class Record:Record,Object*/
88-
/*cfe|cfe:builder.class: Record:Object,Record*/
89-
class Record {}

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import 'package:analyzer/dart/element/type_provider.dart';
1717
import 'package:analyzer/diagnostic/diagnostic.dart';
1818
import 'package:analyzer/error/error.dart';
1919
import 'package:analyzer/error/listener.dart';
20-
import 'package:analyzer/src/dart/analysis/experiments.dart';
2120
import 'package:analyzer/src/dart/ast/ast.dart';
2221
import 'package:analyzer/src/dart/ast/extensions.dart';
2322
import 'package:analyzer/src/dart/element/class_hierarchy.dart';
@@ -1026,16 +1025,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
10261025
@override
10271026
void visitNamedType(NamedType node) {
10281027
_typeArgumentsVerifier.checkNamedType(node);
1029-
bool isDartCoreRecordVisible =
1030-
_currentLibrary.featureSet.isEnabled(Feature.records) ||
1031-
FeatureSet.latestLanguageVersion().isEnabled(Feature.records);
1032-
if ((node.type?.isDartCoreRecord ?? false) && !isDartCoreRecordVisible) {
1033-
errorReporter.reportErrorForToken(
1034-
ParserErrorCode.EXPERIMENT_NOT_ENABLED, node.beginToken, [
1035-
Feature.records.enableString,
1036-
"${Feature.records.releaseVersion ?? ExperimentStatus.currentVersion}"
1037-
]);
1038-
}
10391028
super.visitNamedType(node);
10401029
}
10411030

@@ -1176,23 +1165,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
11761165
_checkForUnqualifiedReferenceToNonLocalStaticMember(node);
11771166
}
11781167
_checkUseVerifier.checkSimpleIdentifier(node);
1179-
1180-
bool isDartCoreRecordVisible =
1181-
_currentLibrary.featureSet.isEnabled(Feature.records) ||
1182-
FeatureSet.latestLanguageVersion().isEnabled(Feature.records);
1183-
Element? staticElement = node.staticElement;
1184-
if ((staticElement is ClassElement &&
1185-
staticElement.thisType.isDartCoreRecord ||
1186-
staticElement is TypeAliasElement &&
1187-
staticElement.aliasedType.isDartCoreRecord) &&
1188-
!isDartCoreRecordVisible) {
1189-
errorReporter.reportErrorForToken(
1190-
ParserErrorCode.EXPERIMENT_NOT_ENABLED, node.beginToken, [
1191-
Feature.records.enableString,
1192-
"${Feature.records.releaseVersion ?? ExperimentStatus.currentVersion}"
1193-
]);
1194-
}
1195-
11961168
super.visitSimpleIdentifier(node);
11971169
}
11981170

pkg/front_end/lib/src/fasta/builder/class_builder.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:kernel/ast.dart'
1111
DynamicType,
1212
FutureOrType,
1313
InterfaceType,
14-
InvalidType,
1514
Member,
1615
Name,
1716
NullType,
@@ -347,15 +346,6 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl
347346
int charOffset,
348347
ClassHierarchyBase? hierarchy,
349348
{required bool hasExplicitTypeArguments}) {
350-
if (name == "Record" &&
351-
libraryBuilder.importUri.scheme == "dart" &&
352-
libraryBuilder.importUri.path == "core" &&
353-
library is SourceLibraryBuilder &&
354-
!library.libraryFeatures.records.isEnabled) {
355-
library.reportFeatureNotEnabled(
356-
library.libraryFeatures.records, fileUri, charOffset, name.length);
357-
return const InvalidType();
358-
}
359349
return buildAliasedTypeWithBuiltArguments(
360350
library,
361351
nullabilityBuilder.build(library),

pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class ConstructorReferenceBuilder {
5555
PrefixBuilder prefix = declaration;
5656
declaration = prefix.lookup(middle, name.charOffset, fileUri);
5757
} else if (declaration is ClassBuilder) {
58-
declaration = declaration.findConstructorOrFactory(
58+
ClassBuilder cls = declaration;
59+
declaration = cls.findConstructorOrFactory(
5960
middle, name.charOffset, fileUri, accessingLibrary);
6061
if (suffix == null) {
6162
target = declaration;

pkg/front_end/lib/src/fasta/builder/named_type_builder.dart

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
library fasta.named_type_builder;
66

7-
import 'package:front_end/src/fasta/util/helpers.dart';
87
import 'package:kernel/ast.dart';
98
import 'package:kernel/class_hierarchy.dart';
109
import 'package:kernel/src/legacy_erasure.dart';
@@ -409,16 +408,7 @@ abstract class NamedTypeBuilder extends TypeBuilder {
409408
DartType buildAliased(
410409
LibraryBuilder library, TypeUse typeUse, ClassHierarchyBase? hierarchy) {
411410
assert(hierarchy != null || isExplicit, "Cannot build $this.");
412-
413-
DartType builtType = _buildAliasedInternal(library, typeUse, hierarchy);
414-
415-
if (library is SourceLibraryBuilder &&
416-
!checkRecordOrItsAliasAccessAllowed(builtType, library)) {
417-
library.reportFeatureNotEnabled(library.libraryFeatures.records,
418-
fileUri ?? library.fileUri, charOffset!, nameText.length);
419-
}
420-
421-
return builtType;
411+
return _buildAliasedInternal(library, typeUse, hierarchy);
422412
}
423413

424414
DartType _buildAliasedInternal(
@@ -705,15 +695,7 @@ class _ExplicitNamedTypeBuilder extends NamedTypeBuilder {
705695
@override
706696
DartType build(LibraryBuilder library, TypeUse typeUse,
707697
{ClassHierarchyBase? hierarchy}) {
708-
DartType builtType = _buildInternal(library, typeUse, hierarchy);
709-
710-
if (library is SourceLibraryBuilder &&
711-
!checkRecordOrItsAliasAccessAllowed(builtType, library)) {
712-
library.reportFeatureNotEnabled(library.libraryFeatures.records,
713-
fileUri ?? library.fileUri, charOffset!, nameText.length);
714-
}
715-
716-
return _type ??= builtType;
698+
return _type ??= _buildInternal(library, typeUse, hierarchy);
717699
}
718700
}
719701

pkg/front_end/lib/src/fasta/builder/prefix_builder.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class PrefixBuilder extends BuilderImpl {
4747
@override
4848
Uri get fileUri => parent.fileUri;
4949

50-
/// Lookup a member with [name] in the export scope.
5150
Builder? lookup(String name, int charOffset, Uri fileUri) {
5251
return exportScope.lookup(name, charOffset, fileUri);
5352
}

pkg/front_end/lib/src/fasta/denylisted_classes.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const List<String> denylistedCoreClasses = [
99
"num",
1010
"double",
1111
"String",
12-
"Null",
13-
"Record",
12+
"Null"
1413
];
1514

1615
// List of special classes in dart:typed_data that can't be subclassed.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ import '../type_inference/inference_results.dart'
106106
import '../type_inference/type_inferrer.dart'
107107
show TypeInferrer, InferredFunctionBody;
108108
import '../type_inference/type_schema.dart' show UnknownType;
109-
import '../util/helpers.dart';
109+
import '../util/helpers.dart' show DelayedActionPerformer;
110110
import 'collections.dart';
111111
import 'constness.dart' show Constness;
112112
import 'constructor_tearoff_lowering.dart';

pkg/front_end/lib/src/fasta/scope.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ class Scope extends MutableScope {
419419
}
420420
}
421421

422-
/// Lookup a member with [name] in the scope.
423422
Builder? lookup(String name, int charOffset, Uri fileUri,
424423
{bool isInstanceScope = true}) {
425424
recordUse(name, charOffset);

pkg/front_end/lib/src/fasta/source/source_loader.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,8 +2743,6 @@ class int extends num {}
27432743
class num {}
27442744
27452745
class Function {}
2746-
2747-
class Record {}
27482746
""";
27492747

27502748
/// A minimal implementation of dart:async that is sufficient to create an

pkg/front_end/lib/src/fasta/util/helpers.dart

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:kernel/ast.dart';
6-
7-
import '../source/source_library_builder.dart';
8-
95
abstract class DelayedActionPerformer {
106
bool get hasDelayedActions;
117
void performDelayedActions({required bool allowFurtherDelays});
128
}
13-
14-
bool checkRecordOrItsAliasAccessAllowed(
15-
DartType type, SourceLibraryBuilder accessorLibrary) {
16-
Class? targetClass;
17-
if (type is InterfaceType) {
18-
targetClass = type.classNode;
19-
} else if (type is TypedefType) {
20-
DartType unaliasedType = type.unalias;
21-
if (unaliasedType is InterfaceType) {
22-
targetClass = unaliasedType.classNode;
23-
}
24-
}
25-
return accessorLibrary.libraryFeatures.records.isEnabled ||
26-
accessorLibrary.libraryFeatures.records.flag.isEnabledByDefault ||
27-
!(targetClass != null &&
28-
targetClass.parent != null &&
29-
targetClass.name == "Record" &&
30-
targetClass.enclosingLibrary.importUri.scheme == "dart" &&
31-
targetClass.enclosingLibrary.importUri.path == "core");
32-
}

pkg/front_end/test/spell_checking_list_common.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,6 @@ following
12571257
follows
12581258
food
12591259
for
1260-
forbid
12611260
forbidden
12621261
force
12631262
forced
@@ -1389,7 +1388,6 @@ head
13891388
header
13901389
headers
13911390
heading
1392-
heavier
13931391
help
13941392
helper
13951393
helpers

pkg/front_end/test/spell_checking_list_tests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ risky
560560
rk
561561
row
562562
rows
563-
rr
564563
runtimes
565564
rv
566565
sanitize

pkg/front_end/testcases/general/error_export_from_dill/main.dart.weak.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ additionalExports = (core::Deprecated,
137137
core::Object,
138138
core::Pattern,
139139
core::Match,
140-
core::Record,
141140
core::RegExp,
142141
core::RegExpMatch,
143142
core::Set,

pkg/front_end/testcases/general/error_export_from_dill/main.dart.weak.outline.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ additionalExports = (core::Deprecated,
7272
core::Object,
7373
core::Pattern,
7474
core::Match,
75-
core::Record,
7675
core::RegExp,
7776
core::RegExpMatch,
7877
core::Set,

pkg/front_end/testcases/general/error_export_from_dill/main.dart.weak.transformed.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ additionalExports = (core::Deprecated,
133133
core::Object,
134134
core::Pattern,
135135
core::Match,
136-
core::Record,
137136
core::RegExp,
138137
core::RegExpMatch,
139138
core::Set,

pkg/front_end/testcases/incremental/export_core.yaml.world.2.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ additionalExports = (asy::Future,
5050
core::Pattern,
5151
core::Provisional,
5252
core::RangeError,
53-
core::Record,
5453
core::RegExp,
5554
core::RegExpMatch,
5655
core::RuneIterator,

pkg/front_end/testcases/incremental/export_core.yaml.world.3.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ additionalExports = (asy::Future,
5050
core::Pattern,
5151
core::Provisional,
5252
core::RangeError,
53-
core::Record,
5453
core::RegExp,
5554
core::RegExpMatch,
5655
core::RuneIterator,

pkg/front_end/testcases/records/custom_record_class_unsupported.dart

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.strong.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.strong.transformed.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.textual_outline.expect

Lines changed: 0 additions & 6 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.textual_outline_modelled.expect

Lines changed: 0 additions & 6 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.weak.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.weak.modular.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.weak.outline.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

pkg/front_end/testcases/records/custom_record_class_unsupported.dart.weak.transformed.expect

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)