blob: ff2a47576a8a05a0f05ac9825fed0cce6ee40bb2 [file] [log] [blame]
// Copyright (c) 2020, 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:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
extension ParameterElementExtensions on ParameterElement {
/// Return [ParameterElement] with the specified properties replaced.
ParameterElement copyWith({DartType type, ParameterKind kind}) {
return ParameterElementImpl.synthetic(
name,
type ?? this.type,
// ignore: deprecated_member_use_from_same_package
kind ?? parameterKind,
)..isExplicitlyCovariant = isCovariant;
}
}