[element model] migrate `prefer_const_literals_to_create_immutables`

Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: Ie2e8976efefccbf56dddaae4240596c916aa42b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388180
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/linter/lib/src/rules/prefer_const_literals_to_create_immutables.dart b/pkg/linter/lib/src/rules/prefer_const_literals_to_create_immutables.dart
index 21ddfc4..abe1a59 100644
--- a/pkg/linter/lib/src/rules/prefer_const_literals_to_create_immutables.dart
+++ b/pkg/linter/lib/src/rules/prefer_const_literals_to_create_immutables.dart
@@ -80,7 +80,7 @@
 
     InterfaceType? current = type;
     while (current != null) {
-      if (current.element.hasImmutable) return true;
+      if (current.element3.hasImmutable) return true;
       current = current.superclass;
     }