Version 2.13.0-222.0.dev Merge commit 'ea50eeb4beb07d8e0a672d6fb52d356b523a6392' into 'dev'
diff --git a/pkg/analysis_server/test/lsp/initialization_test.dart b/pkg/analysis_server/test/lsp/initialization_test.dart index 0bd91e3..fc6b1fc 100644 --- a/pkg/analysis_server/test/lsp/initialization_test.dart +++ b/pkg/analysis_server/test/lsp/initialization_test.dart
@@ -313,7 +313,7 @@ } Future<void> test_emptyAnalysisRoots_projectWithoutPubspec() async { - projectFolderPath = '/home/empty'; + projectFolderPath = convertPath('/home/empty'); final nestedFilePath = join( projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart'); final nestedFileUri = Uri.file(nestedFilePath); @@ -534,7 +534,7 @@ } Future<void> test_onlyAnalyzeProjectsWithOpenFiles_withoutPubpsec() async { - projectFolderPath = '/home/empty'; + projectFolderPath = convertPath('/home/empty'); final nestedFilePath = join( projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart'); final nestedFileUri = Uri.file(nestedFilePath);
diff --git a/pkg/vm/lib/transformations/type_flow/signature_shaking.dart b/pkg/vm/lib/transformations/type_flow/signature_shaking.dart index 20a0412..c6c7608 100644 --- a/pkg/vm/lib/transformations/type_flow/signature_shaking.dart +++ b/pkg/vm/lib/transformations/type_flow/signature_shaking.dart
@@ -498,6 +498,12 @@ super.visitProcedure(node); } + @override + void visitField(Field node) { + typeContext = StaticTypeContext(node, shaker.typeFlowAnalysis.environment); + super.visitField(node); + } + static void forEachArgumentRev(Arguments args, _ProcedureInfo info, void Function(Expression, _ParameterInfo) fun) { for (int i = args.named.length - 1; i >= 0; i--) {
diff --git a/tests/language/regress/regress45642_test.dart b/tests/language/regress/regress45642_test.dart new file mode 100644 index 0000000..9222e13 --- /dev/null +++ b/tests/language/regress/regress45642_test.dart
@@ -0,0 +1,15 @@ +// Copyright (c) 2021, 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. + +class Utils { + static final foo = Foo(() {}); +} + +class Foo { + Foo(func); +} + +void main() { + print(Utils.foo); // should print: Instance of 'Foo' +}
diff --git a/tests/language_2/regress/regress45642_test.dart b/tests/language_2/regress/regress45642_test.dart new file mode 100644 index 0000000..9222e13 --- /dev/null +++ b/tests/language_2/regress/regress45642_test.dart
@@ -0,0 +1,15 @@ +// Copyright (c) 2021, 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. + +class Utils { + static final foo = Foo(() {}); +} + +class Foo { + Foo(func); +} + +void main() { + print(Utils.foo); // should print: Instance of 'Foo' +}
diff --git a/tools/VERSION b/tools/VERSION index 798da76..148a455 100644 --- a/tools/VERSION +++ b/tools/VERSION
@@ -27,5 +27,5 @@ MAJOR 2 MINOR 13 PATCH 0 -PRERELEASE 221 +PRERELEASE 222 PRERELEASE_PATCH 0 \ No newline at end of file