Skip to content

Commit 4d8b468

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate error_verifier (enclosing element getters)
Cleans up getters as per our discussion. Sorry for the delay on this one! Change-Id: I3eabce599d5ea4696c7c478b0ca3aedb4097a5eb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410661 Commit-Queue: Phil Quitslund <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 6810733 commit 4d8b468

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,17 +318,12 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
318318

319319
/// The class containing the AST nodes being visited, or `null` if we are not
320320
/// in the scope of a class.
321-
InterfaceElement2? get _enclosingClass2 => switch (_enclosingClass) {
322-
InterfaceElement element => element.asElement2,
323-
_ => null,
324-
};
321+
InterfaceElement2? get _enclosingClass2 => _enclosingClass?.asElement2;
325322

326323
/// The element of the extension being visited, or `null` if we are not
327324
/// in the scope of an extension.
328-
ExtensionElement2? get _enclosingExtension2 => switch (_enclosingExtension) {
329-
ExtensionElement element => element.asElement2,
330-
_ => null,
331-
};
325+
ExtensionElement2? get _enclosingExtension2 =>
326+
_enclosingExtension?.asElement2;
332327

333328
/// The language team is thinking about adding abstract fields, or external
334329
/// fields. But for now we will ignore such fields in `Struct` subtypes.

0 commit comments

Comments
 (0)