Version 3.8.0-33.0.dev
Merge 862ca5b12e13d38362815918a9d51cfba5083b6e into dev
diff --git a/pkg/frontend_server/pubspec.yaml b/pkg/frontend_server/pubspec.yaml
index 6e8f1f2..75431eb 100644
--- a/pkg/frontend_server/pubspec.yaml
+++ b/pkg/frontend_server/pubspec.yaml
@@ -24,7 +24,5 @@
 # Use 'any' constraints here; we get our versions from the DEPS file.
 dev_dependencies:
   collection: any
-  const_finder_fixtures: any
-  const_finder_fixtures_package: any
   lints: any
   test: any
diff --git a/pkg/frontend_server/test/const_finder_test.dart b/pkg/frontend_server/test/const_finder_test.dart
index eac36ab..24c87f2 100644
--- a/pkg/frontend_server/test/const_finder_test.dart
+++ b/pkg/frontend_server/test/const_finder_test.dart
@@ -142,7 +142,7 @@
     expectation['nonConstantLocations'] = <Object?>[
       <String, dynamic>{
         'file': 'file://$fixturesUrl/pkg/package.dart',
-        'line': 13,
+        'line': 17,
         'column': 25,
       },
     ];
@@ -256,27 +256,27 @@
       'nonConstantLocations': <dynamic>[
         <String, dynamic>{
           'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 13,
-          'column': 26,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 7,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 22,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
           'line': 17,
           'column': 26,
         },
         <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 7,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 22,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 21,
+          'column': 26,
+        },
+        <String, dynamic>{
           'file': 'file://$fixturesUrl/pkg/package.dart',
-          'line': 13,
+          'line': 17,
           'column': 25,
         }
       ]
@@ -343,27 +343,27 @@
       'nonConstantLocations': <dynamic>[
         <String, dynamic>{
           'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 13,
-          'column': 26,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 7,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
-          'line': 16,
-          'column': 22,
-        },
-        <String, dynamic>{
-          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
           'line': 17,
           'column': 26,
         },
         <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 7,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 20,
+          'column': 22,
+        },
+        <String, dynamic>{
+          'file': 'file://$fixturesUrl/lib/consts_and_non.dart',
+          'line': 21,
+          'column': 26,
+        },
+        <String, dynamic>{
           'file': 'file://$fixturesUrl/pkg/package.dart',
-          'line': 13,
+          'line': 17,
           'column': 25,
         }
       ],
@@ -581,4 +581,4 @@
     }
     return super.equals(e1, e2);
   }
-}
+}
\ No newline at end of file
diff --git a/pkg/frontend_server/test/fixtures/lib/consts.dart b/pkg/frontend_server/test/fixtures/lib/consts.dart
index 8bc8749..f19fb1b 100644
--- a/pkg/frontend_server/test/fixtures/lib/consts.dart
+++ b/pkg/frontend_server/test/fixtures/lib/consts.dart
@@ -2,6 +2,10 @@
 // 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.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'dart:core';
 
 import 'package:const_finder_fixtures_package/package.dart';
diff --git a/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart b/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
index 40a6f76..96e97c1 100644
--- a/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
+++ b/pkg/frontend_server/test/fixtures/lib/consts_and_non.dart
@@ -2,6 +2,10 @@
 // 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.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'dart:core';
 
 import 'package:const_finder_fixtures_package/package.dart';
diff --git a/pkg/frontend_server/test/fixtures/pkg/package.dart b/pkg/frontend_server/test/fixtures/pkg/package.dart
index 124adee..1df5fab 100644
--- a/pkg/frontend_server/test/fixtures/pkg/package.dart
+++ b/pkg/frontend_server/test/fixtures/pkg/package.dart
@@ -2,6 +2,10 @@
 // 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.
 
+// This test is always used with a custom package_config.json, so don't validate
+// the imports against the pubspec.yaml.
+// @skip_package_deps_validation
+
 import 'package:const_finder_fixtures/target.dart';
 
 void createTargetInPackage() {
diff --git a/pkg/pkg.status b/pkg/pkg.status
index be29f2c..9542b63 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -163,6 +163,7 @@
 vm_service/test/issue_30555_test: SkipByDesign # Debugger is disabled in AOT mode.
 vm_service/test/issue_56911_test: SkipByDesign # Debugger is disabled in AOT mode.
 vm_service/test/issue_57040_test: SkipByDesign # Debugger is disabled in AOT mode.
+vm_service/test/issue_59653_test: SkipByDesign # Debugger is disabled in AOT mode.
 vm_service/test/issue_59661_test: SkipByDesign # Debugger is disabled in AOT mode.
 vm_service/test/kill_paused_test: SkipByDesign # Debugger is disabled in AOT mode.
 vm_service/test/library_dependency_test: SkipByDesign # Uses 'dart:mirrors' library.
diff --git a/pkg/vm_service/test/common/service_test_common.dart b/pkg/vm_service/test/common/service_test_common.dart
index cf9d9c8..ac6c08f 100644
--- a/pkg/vm_service/test/common/service_test_common.dart
+++ b/pkg/vm_service/test/common/service_test_common.dart
@@ -889,3 +889,41 @@
     }
   };
 }
+
+/// This helper does 3 things:
+/// 1) makes sure it's at the expected frame ([topFrameName]).
+/// 2) checks that the expected variables are available (by name)
+///    ([availableVariables]).
+/// 3) Evaluates the given expression(s) and checks their (valueAsString) result
+///    ([evaluations]).
+IsolateTest testExpressionEvaluationAndAvailableVariables(
+  String topFrameName,
+  List<String> availableVariables,
+  List<(String evaluate, String evaluationResult)> evaluations,
+) {
+  return (VmService service, IsolateRef isolateRef) async {
+    final isolateId = isolateRef.id!;
+    final stack = await service.getStack(isolateId);
+
+    // Make sure we are in the right place.
+    expect(stack.frames!.length, greaterThanOrEqualTo(1));
+    expect(stack.frames![0].function!.name, topFrameName);
+
+    // Check variables.
+    expect(
+      (stack.frames![0].vars ?? []).map((v) => v.name).toList(),
+      equals(availableVariables),
+    );
+
+    // Evaluate.
+    for (final (expression, expectedResult) in evaluations) {
+      final result = await service.evaluateInFrame(
+        isolateId,
+        /* frame = */ 0,
+        expression,
+      ) as InstanceRef;
+      print(result.valueAsString);
+      expect(result.valueAsString, equals(expectedResult));
+    }
+  };
+}
diff --git a/pkg/vm_service/test/issue_56911_test.dart b/pkg/vm_service/test/issue_56911_test.dart
index b46e0fa..a7a9179 100644
--- a/pkg/vm_service/test/issue_56911_test.dart
+++ b/pkg/vm_service/test/issue_56911_test.dart
@@ -3,8 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:developer';
-import 'package:test/test.dart';
-import 'package:vm_service/vm_service.dart';
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
@@ -14,8 +12,8 @@
 //
 // dart pkg/vm_service/test/update_line_numbers.dart pkg/vm_service/test/issue_56911_test.dart
 //
-const LINE_A = 28;
-const LINE_B = 32;
+const LINE_A = 26;
+const LINE_B = 30;
 // AUTOGENERATED END
 
 extension type ExtensionType._(String s) {
@@ -34,42 +32,10 @@
   });
 }
 
-Future<void> Function(VmService, IsolateRef) test(
-  String topFrameName,
-  List<String> availableVariables,
-  List<(String evaluate, String evaluationResult)> evaluations,
-) {
-  return (VmService service, IsolateRef isolateRef) async {
-    final isolateId = isolateRef.id!;
-    final stack = await service.getStack(isolateId);
-
-    // Make sure we are in the right place.
-    expect(stack.frames!.length, greaterThanOrEqualTo(1));
-    expect(stack.frames![0].function!.name, topFrameName);
-
-    // Check variables.
-    expect(
-      (stack.frames![0].vars ?? []).map((v) => v.name).toList(),
-      equals(availableVariables),
-    );
-
-    // Evaluate.
-    for (final (expression, expectedResult) in evaluations) {
-      final result = await service.evaluateInFrame(
-        isolateId,
-        /* frame = */ 0,
-        expression,
-      ) as InstanceRef;
-      print(result.valueAsString);
-      expect(result.valueAsString, equals(expectedResult));
-    }
-  };
-}
-
 final tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
-  test('code', [
+  testExpressionEvaluationAndAvailableVariables('code', [
     'list',
   ], [
     ('() { return list.single.value; }()', '48'),
@@ -78,7 +44,7 @@
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
-  test('<anonymous closure>', [
+  testExpressionEvaluationAndAvailableVariables('<anonymous closure>', [
     'input',
   ], [
     ('() { return input.value; }()', '48'),
diff --git a/pkg/vm_service/test/issue_57040_test.dart b/pkg/vm_service/test/issue_57040_test.dart
index e5f3bbe..42426b6 100644
--- a/pkg/vm_service/test/issue_57040_test.dart
+++ b/pkg/vm_service/test/issue_57040_test.dart
@@ -3,8 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:developer';
-import 'package:test/test.dart';
-import 'package:vm_service/vm_service.dart';
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
@@ -14,8 +12,8 @@
 //
 // dart pkg/vm_service/test/update_line_numbers.dart pkg/vm_service/test/issue_57040_test.dart
 //
-const LINE_A = 30;
-const LINE_B = 33;
+const LINE_A = 28;
+const LINE_B = 31;
 // AUTOGENERATED END
 
 extension on String? {
@@ -34,42 +32,10 @@
   print(str.isNullOrEmpty);
 }
 
-Future<void> Function(VmService, IsolateRef) test(
-  String topFrameName,
-  List<String> availableVariables,
-  List<(String evaluate, String evaluationResult)> evaluations,
-) {
-  return (VmService service, IsolateRef isolateRef) async {
-    final isolateId = isolateRef.id!;
-    final stack = await service.getStack(isolateId);
-
-    // Make sure we are in the right place.
-    expect(stack.frames!.length, greaterThanOrEqualTo(1));
-    expect(stack.frames![0].function!.name, topFrameName);
-
-    // Check variables.
-    expect(
-      (stack.frames![0].vars ?? []).map((v) => v.name).toList(),
-      equals(availableVariables),
-    );
-
-    // Evaluate.
-    for (final (expression, expectedResult) in evaluations) {
-      final result = await service.evaluateInFrame(
-        isolateId,
-        /* frame = */ 0,
-        expression,
-      ) as InstanceRef;
-      print(result.valueAsString);
-      expect(result.valueAsString, equals(expectedResult));
-    }
-  };
-}
-
 final tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_A),
-  test('code', [
+  testExpressionEvaluationAndAvailableVariables('code', [
     'str',
   ], [
     ('() { return str.isNullOrEmpty; }()', 'false'),
@@ -78,7 +44,7 @@
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_B),
-  test('code', [
+  testExpressionEvaluationAndAvailableVariables('code', [
     'str',
   ], [
     ('() { return str.isNullOrEmpty; }()', 'true'),
diff --git a/pkg/vm_service/test/issue_59653_test.dart b/pkg/vm_service/test/issue_59653_test.dart
new file mode 100644
index 0000000..3d4d4e4
--- /dev/null
+++ b/pkg/vm_service/test/issue_59653_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2025, 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 'dart:developer';
+import 'common/service_test_common.dart';
+import 'common/test_helper.dart';
+
+// AUTOGENERATED START
+//
+// Update these constants by running:
+//
+// dart pkg/vm_service/test/update_line_numbers.dart pkg/vm_service/test/issue_59653_test.dart
+//
+const LINE_A = 36;
+// AUTOGENERATED END
+
+abstract interface class SharedTypeStructure {}
+
+extension type SharedTypeSchemaView<TypeStructure extends SharedTypeStructure>(
+    TypeStructure _typeStructure) implements Object {}
+
+class C extends SharedTypeStructure {
+  @override
+  String toString() => 'C!';
+}
+
+class ClassWithTypeAnalyzer<TypeStructure extends SharedTypeStructure> {
+  SharedTypeSchemaView<TypeStructure> dispatchExpression(
+    SharedTypeSchemaView<TypeStructure> schema,
+  ) {
+    return schema;
+  }
+
+  void analyzeExpression(SharedTypeSchemaView<TypeStructure> schema) {
+    debugger(); // LINE_A
+  }
+}
+
+void code() {
+  final classWithTypeAnalyzer = ClassWithTypeAnalyzer<C>();
+  classWithTypeAnalyzer.analyzeExpression(SharedTypeSchemaView(C()));
+}
+
+final tests = <IsolateTest>[
+  hasStoppedAtBreakpoint,
+  stoppedAtLine(LINE_A),
+  testExpressionEvaluationAndAvailableVariables('analyzeExpression', [
+    'this',
+    'schema',
+  ], [
+    ('1', '1'),
+    ('dispatchExpression(schema).toString()', 'C!'),
+  ]),
+];
+
+void main([args = const <String>[]]) => runIsolateTests(
+      args,
+      tests,
+      'issue_59653_test.dart',
+      testeeConcurrent: code,
+      pauseOnStart: false,
+      pauseOnExit: true,
+    );
diff --git a/pkg/vm_service/test/issue_59661_test.dart b/pkg/vm_service/test/issue_59661_test.dart
index ed22d89..29e24a6 100644
--- a/pkg/vm_service/test/issue_59661_test.dart
+++ b/pkg/vm_service/test/issue_59661_test.dart
@@ -3,8 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:developer';
-import 'package:test/test.dart';
-import 'package:vm_service/vm_service.dart';
 import 'common/service_test_common.dart';
 import 'common/test_helper.dart';
 
@@ -14,12 +12,12 @@
 //
 // dart pkg/vm_service/test/update_line_numbers.dart pkg/vm_service/test/issue_59661_test.dart
 //
-const LINE_CLASS_A = 29;
-const LINE_CLASS_A_NAMED = 34;
-const LINE_CLASS_A_NAMED2_BREAK_1 = 40;
-const LINE_CLASS_A_NAMED2_BREAK_2 = 43;
-const LINE_CLASS_A_NAMED2_BREAK_3 = 46;
-const LINE_CLASS_B = 55;
+const LINE_CLASS_A = 27;
+const LINE_CLASS_A_NAMED = 32;
+const LINE_CLASS_A_NAMED2_BREAK_1 = 38;
+const LINE_CLASS_A_NAMED2_BREAK_2 = 41;
+const LINE_CLASS_A_NAMED2_BREAK_3 = 44;
+const LINE_CLASS_B = 53;
 // AUTOGENERATED END
 
 class A {
@@ -64,50 +62,26 @@
   B([1, 2]);
 }
 
-Future<void> Function(VmService, IsolateRef) test(
-  String topFrameName,
-  List<String> availableVariables,
-  List<(String evaluate, String evaluationResult)> evaluations,
-) {
-  return (VmService service, IsolateRef isolateRef) async {
-    final isolateId = isolateRef.id!;
-    final stack = await service.getStack(isolateId);
-
-    // Make sure we are in the right place.
-    expect(stack.frames!.length, greaterThanOrEqualTo(1));
-    expect(stack.frames![0].function!.name, topFrameName);
-
-    // Check variables.
-    expect(
-      (stack.frames![0].vars ?? []).map((v) => v.name).toList(),
-      equals(availableVariables),
-    );
-
-    // Evaluate.
-    for (final (expression, expectedResult) in evaluations) {
-      final dynamic result = await service.evaluateInFrame(
-        isolateId,
-        /* frame = */ 0,
-        expression,
-      );
-      print(result.valueAsString);
-      expect(result.valueAsString, equals(expectedResult));
-    }
-  };
-}
-
 final tests = <IsolateTest>[
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_A),
-  test('A', ['this'], [('list.toString()', '[3]')]),
+  testExpressionEvaluationAndAvailableVariables(
+    'A',
+    ['this'],
+    [('list.toString()', '[3]')],
+  ),
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_A_NAMED),
-  test('A.named', ['this'], [('list.toString()', '[4]')]),
+  testExpressionEvaluationAndAvailableVariables(
+    'A.named',
+    ['this'],
+    [('list.toString()', '[4]')],
+  ),
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_A_NAMED2_BREAK_1),
-  test(
+  testExpressionEvaluationAndAvailableVariables(
     'A.named2',
     ['this', 'list'],
     [
@@ -118,15 +92,27 @@
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_A_NAMED2_BREAK_2),
-  test('A.named2', ['this'], [('list.toString()', '[1, 2]')]),
+  testExpressionEvaluationAndAvailableVariables(
+    'A.named2',
+    ['this'],
+    [('list.toString()', '[1, 2]')],
+  ),
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_A_NAMED2_BREAK_3),
-  test('A.named2', ['this'], [('list.toString()', '[6]')]),
+  testExpressionEvaluationAndAvailableVariables(
+    'A.named2',
+    ['this'],
+    [('list.toString()', '[6]')],
+  ),
   resumeIsolate,
   hasStoppedAtBreakpoint,
   stoppedAtLine(LINE_CLASS_B),
-  test('B', ['this'], [('list.toString()', '[7]')]),
+  testExpressionEvaluationAndAvailableVariables(
+    'B',
+    ['this'],
+    [('list.toString()', '[7]')],
+  ),
 ];
 
 void main([args = const <String>[]]) => runIsolateTests(
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
index 813b37a..a363985 100644
--- a/runtime/vm/compiler/frontend/kernel_translation_helper.cc
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -3586,6 +3586,14 @@
     const intptr_t class_type_parameter_count =
         active_class_->klass->NumTypeParameters();
     if (class_type_parameter_count > parameter_index) {
+      if (H.GetExpressionEvaluationClass().ptr() ==
+          active_class_->klass->ptr()) {
+        ASSERT(H.GetExpressionEvaluationClass().NumTypeParameters() ==
+               active_class_->klass->NumTypeParameters());
+        result_ = H.GetExpressionEvaluationRealClass().TypeParameterAt(
+            parameter_index, nullability);
+        return;
+      }
       result_ =
           active_class_->klass->TypeParameterAt(parameter_index, nullability);
       return;
diff --git a/tools/VERSION b/tools/VERSION
index 1756e02..1456b26 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 3
 MINOR 8
 PATCH 0
-PRERELEASE 32
+PRERELEASE 33
 PRERELEASE_PATCH 0
diff --git a/tools/package_deps/bin/package_deps.dart b/tools/package_deps/bin/package_deps.dart
index e9df384..f6ebfd3 100644
--- a/tools/package_deps/bin/package_deps.dart
+++ b/tools/package_deps/bin/package_deps.dart
@@ -371,7 +371,8 @@
 
     for (var line in file.readAsLinesSync()) {
       // Check for a few tokens that should stop our parse.
-      if (line.startsWith('class ') ||
+      if (line.startsWith('// @skip_package_deps_validation') ||
+          line.startsWith('class ') ||
           line.startsWith('typedef ') ||
           line.startsWith('mixin ') ||
           line.startsWith('enum ') ||