Skip to content

Commit

Permalink
Version 2.13.0-46.0.dev
Browse files Browse the repository at this point in the history
Merge commit 'f0ec362a1c082bf9c29e805f1bf7981d38eff8a9' into 'dev'
  • Loading branch information
Dart CI committed Feb 17, 2021
2 parents d70fb6e + f0ec362 commit fc5e80c
Show file tree
Hide file tree
Showing 16 changed files with 1,056 additions and 470 deletions.
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/error/error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ const List<ErrorCode> errorCodeValues = [
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS,
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS,
FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH,
HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR,
HintCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER,
HintCode.ASSIGNMENT_OF_DO_NOT_STORE,
HintCode.CAN_BE_NULL_AFTER_NULL_AWARE,
HintCode.DEAD_CODE,
Expand Down
39 changes: 31 additions & 8 deletions pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final _knownFeatures = <String, ExperimentalFeature>{
EnableString.control_flow_collections:
ExperimentalFeatures.control_flow_collections,
EnableString.extension_methods: ExperimentalFeatures.extension_methods,
EnableString.extension_types: ExperimentalFeatures.extension_types,
EnableString.generic_metadata: ExperimentalFeatures.generic_metadata,
EnableString.non_nullable: ExperimentalFeatures.non_nullable,
EnableString.nonfunction_type_aliases:
Expand All @@ -39,6 +40,9 @@ class EnableString {
/// String to enable the experiment "extension-methods"
static const String extension_methods = 'extension-methods';

/// String to enable the experiment "extension-types"
static const String extension_types = 'extension-types';

/// String to enable the experiment "generic-metadata"
static const String generic_metadata = 'generic-metadata';

Expand Down Expand Up @@ -95,8 +99,18 @@ class ExperimentalFeatures {
releaseVersion: Version.parse('2.6.0'),
);

static final generic_metadata = ExperimentalFeature(
static final extension_types = ExperimentalFeature(
index: 3,
enableString: EnableString.extension_types,
isEnabledByDefault: IsEnabledByDefault.extension_types,
isExpired: IsExpired.extension_types,
documentation: 'Extension Types',
experimentalReleaseVersion: null,
releaseVersion: Version.parse('2.13.0'),
);

static final generic_metadata = ExperimentalFeature(
index: 4,
enableString: EnableString.generic_metadata,
isEnabledByDefault: IsEnabledByDefault.generic_metadata,
isExpired: IsExpired.generic_metadata,
Expand All @@ -107,7 +121,7 @@ class ExperimentalFeatures {
);

static final non_nullable = ExperimentalFeature(
index: 4,
index: 5,
enableString: EnableString.non_nullable,
isEnabledByDefault: IsEnabledByDefault.non_nullable,
isExpired: IsExpired.non_nullable,
Expand All @@ -117,7 +131,7 @@ class ExperimentalFeatures {
);

static final nonfunction_type_aliases = ExperimentalFeature(
index: 5,
index: 6,
enableString: EnableString.nonfunction_type_aliases,
isEnabledByDefault: IsEnabledByDefault.nonfunction_type_aliases,
isExpired: IsExpired.nonfunction_type_aliases,
Expand All @@ -127,7 +141,7 @@ class ExperimentalFeatures {
);

static final set_literals = ExperimentalFeature(
index: 6,
index: 7,
enableString: EnableString.set_literals,
isEnabledByDefault: IsEnabledByDefault.set_literals,
isExpired: IsExpired.set_literals,
Expand All @@ -137,7 +151,7 @@ class ExperimentalFeatures {
);

static final spread_collections = ExperimentalFeature(
index: 7,
index: 8,
enableString: EnableString.spread_collections,
isEnabledByDefault: IsEnabledByDefault.spread_collections,
isExpired: IsExpired.spread_collections,
Expand All @@ -147,7 +161,7 @@ class ExperimentalFeatures {
);

static final triple_shift = ExperimentalFeature(
index: 8,
index: 9,
enableString: EnableString.triple_shift,
isEnabledByDefault: IsEnabledByDefault.triple_shift,
isExpired: IsExpired.triple_shift,
Expand All @@ -157,7 +171,7 @@ class ExperimentalFeatures {
);

static final value_class = ExperimentalFeature(
index: 9,
index: 10,
enableString: EnableString.value_class,
isEnabledByDefault: IsEnabledByDefault.value_class,
isExpired: IsExpired.value_class,
Expand All @@ -167,7 +181,7 @@ class ExperimentalFeatures {
);

static final variance = ExperimentalFeature(
index: 10,
index: 11,
enableString: EnableString.variance,
isEnabledByDefault: IsEnabledByDefault.variance,
isExpired: IsExpired.variance,
Expand All @@ -189,6 +203,9 @@ class IsEnabledByDefault {
/// Default state of the experiment "extension-methods"
static const bool extension_methods = true;

/// Default state of the experiment "extension-types"
static const bool extension_types = true;

/// Default state of the experiment "generic-metadata"
static const bool generic_metadata = false;

Expand Down Expand Up @@ -227,6 +244,9 @@ class IsExpired {
/// Expiration status of the experiment "extension-methods"
static const bool extension_methods = false;

/// Expiration status of the experiment "extension-types"
static const bool extension_types = false;

/// Expiration status of the experiment "generic-metadata"
static const bool generic_metadata = false;

Expand Down Expand Up @@ -265,6 +285,9 @@ mixin _CurrentState {
bool get extension_methods =>
isEnabled(ExperimentalFeatures.extension_methods);

/// Current state for the flag "extension-types"
bool get extension_types => isEnabled(ExperimentalFeatures.extension_types);

/// Current state for the flag "generic-metadata"
bool get generic_metadata => isEnabled(ExperimentalFeatures.generic_metadata);

Expand Down
4 changes: 2 additions & 2 deletions pkg/analyzer/lib/src/dart/error/hint_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class HintCode extends AnalyzerErrorCode {
* 0: the name of the actual argument type
* 1: the name of the expected function return type
*/
static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR =
static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER =
HintCode(
'ARGUMENT_TYPE_NOT_ASSIGNABLE_CATCH_ERROR_ON_ERROR',
'ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER',
"The argument type '{0}' can't be assigned to the parameter type "
"'{1} Function(Object)' or '{1} Function(Object, StackTrace)'.");

Expand Down
10 changes: 5 additions & 5 deletions pkg/analyzer/lib/src/error/best_practices_verifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import 'package:analyzer/src/dart/element/type_system.dart';
import 'package:analyzer/src/dart/resolver/body_inference_context.dart';
import 'package:analyzer/src/dart/resolver/exit_detector.dart';
import 'package:analyzer/src/dart/resolver/scope.dart';
import 'package:analyzer/src/error/catch_error_verifier.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/error/deprecated_member_use_verifier.dart';
import 'package:analyzer/src/error/error_handler_verifier.dart';
import 'package:analyzer/src/error/must_call_super_verifier.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/generated/engine.dart';
Expand Down Expand Up @@ -70,7 +70,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {

final MustCallSuperVerifier _mustCallSuperVerifier;

final CatchErrorVerifier _catchErrorVerifier;
final ErrorHandlerVerifier _errorHandlerVerifier;

/// The [WorkspacePackage] in which [_currentLibrary] is declared.
final WorkspacePackage? _workspacePackage;
Expand Down Expand Up @@ -109,8 +109,8 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
_deprecatedVerifier =
DeprecatedMemberUseVerifier(workspacePackage, _errorReporter),
_mustCallSuperVerifier = MustCallSuperVerifier(_errorReporter),
_catchErrorVerifier =
CatchErrorVerifier(_errorReporter, typeProvider, typeSystem),
_errorHandlerVerifier =
ErrorHandlerVerifier(_errorReporter, typeProvider, typeSystem),
_workspacePackage = workspacePackage {
_deprecatedVerifier.pushInDeprecatedValue(_currentLibrary.hasDeprecated);
_inDoNotStoreMember = _currentLibrary.hasDoNotStore;
Expand Down Expand Up @@ -596,7 +596,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor<void> {
void visitMethodInvocation(MethodInvocation node) {
_deprecatedVerifier.methodInvocation(node);
_checkForNullAwareHints(node, node.operator);
_catchErrorVerifier.verifyMethodInvocation(node);
_errorHandlerVerifier.verifyMethodInvocation(node);
super.visitMethodInvocation(node);
}

Expand Down
150 changes: 0 additions & 150 deletions pkg/analyzer/lib/src/error/catch_error_verifier.dart

This file was deleted.

0 comments on commit fc5e80c

Please sign in to comment.