mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
Use unique instance of NeverElementImpl.
Change-Id: Ie69d563b0e4c86100b3c098dba8832af7a2edae0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251782 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
6bbe04d40f
commit
6ca5af86fe
|
@ -5161,14 +5161,14 @@ class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
|
|||
|
||||
/// The synthetic element representing the declaration of the type `Never`.
|
||||
class NeverElementImpl extends ElementImpl implements TypeDefiningElement {
|
||||
/// Return the unique instance of this class.
|
||||
static NeverElementImpl get instance => NeverTypeImpl.instance.element;
|
||||
/// The unique instance of this class.
|
||||
static final instance = NeverElementImpl._();
|
||||
|
||||
/// Initialize a newly created instance of this class. Instances of this class
|
||||
/// should <b>not</b> be created except as part of creating the type
|
||||
/// associated with this element. The single instance of this class should be
|
||||
/// accessed through the method [instance].
|
||||
NeverElementImpl() : super('Never', -1) {
|
||||
NeverElementImpl._() : super('Never', -1) {
|
||||
setModifier(Modifier.SYNTHETIC, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -894,7 +894,7 @@ class NeverTypeImpl extends TypeImpl implements NeverType {
|
|||
final NullabilitySuffix nullabilitySuffix;
|
||||
|
||||
/// Prevent the creation of instances of this class.
|
||||
NeverTypeImpl._(this.nullabilitySuffix) : super(NeverElementImpl());
|
||||
NeverTypeImpl._(this.nullabilitySuffix) : super(NeverElementImpl.instance);
|
||||
|
||||
@override
|
||||
NeverElementImpl get element => super.element as NeverElementImpl;
|
||||
|
|
Loading…
Reference in a new issue