[_fe_analyzer_shared] Change signature of extension type constructors.

The constructors for `SharedTypeView<TypeStructure>` and
`SharedTypeSchemaView<TypeStructure>` are changed so that they accept
`TypeStructure` rather than `SharedTypeStructure<TypeStructure>`.

For context, I'm currently in the middle of migrating the analyzer so
that it passes a type argument of `TypeImpl` instead of `DartType`
when using generic types that accept a `TypeStructure` type
argument. The purpose of this change is to ensure that when a given
use of `SharedTypeView` or `SharedTypeSchemaView` has its type
argument changed to `TypeImpl`, the type checker will ensure that the
corresponding constructor argument satisfies `TypeImpl`.

There is no change to runtime behavior.

Change-Id: I34d540312b567e390e7dfa535806051e0d5f2868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
diff --git a/pkg/_fe_analyzer_shared/lib/src/types/shared_type.dart b/pkg/_fe_analyzer_shared/lib/src/types/shared_type.dart
index 84b205f..5ed4fb1 100644
--- a/pkg/_fe_analyzer_shared/lib/src/types/shared_type.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/types/shared_type.dart
@@ -193,8 +193,10 @@
 }
 
 extension type SharedTypeSchemaView<
-        TypeStructure extends SharedTypeStructure<TypeStructure>>(
+        TypeStructure extends SharedTypeStructure<TypeStructure>>._(
     SharedTypeStructure<TypeStructure> _typeStructure) implements Object {
+  SharedTypeSchemaView(TypeStructure typeStructure) : this._(typeStructure);
+
   NullabilitySuffix get nullabilitySuffix => _typeStructure.nullabilitySuffix;
 
   String getDisplayString() => _typeStructure.getDisplayString();
@@ -203,8 +205,10 @@
 }
 
 extension type SharedTypeView<
-        TypeStructure extends SharedTypeStructure<TypeStructure>>(
+        TypeStructure extends SharedTypeStructure<TypeStructure>>._(
     SharedTypeStructure<TypeStructure> _typeStructure) implements Object {
+  SharedTypeView(TypeStructure typeStructure) : this._(typeStructure);
+
   NullabilitySuffix get nullabilitySuffix => _typeStructure.nullabilitySuffix;
 
   String getDisplayString() => _typeStructure.getDisplayString();
@@ -248,8 +252,7 @@
 /// [SharedTypeStructureExtension] as follows:
 ///     return e.foo()?.wrapSharedTypeView();
 extension SharedTypeStructureExtension<
-        TypeStructure extends SharedTypeStructure<TypeStructure>>
-    on SharedTypeStructure<TypeStructure> {
+    TypeStructure extends SharedTypeStructure<TypeStructure>> on TypeStructure {
   SharedTypeSchemaView<TypeStructure> wrapSharedTypeSchemaView() {
     return new SharedTypeSchemaView(this);
   }
@@ -261,8 +264,8 @@
 
 extension SharedTypeStructureMapEntryExtension<
     TypeStructure extends SharedTypeStructure<TypeStructure>> on ({
-  SharedTypeStructure<TypeStructure> keyType,
-  SharedTypeStructure<TypeStructure> valueType
+  TypeStructure keyType,
+  TypeStructure valueType
 }) {
   ({
     SharedTypeView<TypeStructure> keyType,