Skip to content

Commit 0629e3a

Browse files
mkustermanncommit-bot@chromium.org
authored andcommitted
[VM] Fix vm/cc/DartAPI_TypeGetParameterizedTypes test
This test was looking up "int", "List" ... in a generated test library instead of the "dart:core" library. It seems like the old lookup has succeded because the C++ parser adds all imports to the library object and the lookup mechanism uses the library scope, which most likely falls back to the import scope. Issue #33042 Change-Id: I37ea756fe53fe5dcbd8efe24053591816d5fc4af Reviewed-on: https://dart-review.googlesource.com/57821 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent e18fd7c commit 0629e3a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

runtime/tests/vm/vm.status

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ dart/wrap_around_in_range_analysis_test: SkipByDesign # The test requires int64.
5656

5757
[ $compiler == dartk ]
5858
cc/DartAPI_New: Fail # Issue #33041
59-
cc/DartAPI_TypeGetParameterizedTypes: Crash # Issue 33042
6059
dart/appjit_cha_deopt_test: SkipSlow # Issue 33266
6160
dart/redirection_type_shuffling_test/00: RuntimeError
6261
dart/redirection_type_shuffling_test/none: RuntimeError

runtime/vm/dart_api_impl_test.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,22 +3618,26 @@ TEST_CASE(DartAPI_TypeGetParameterizedTypes) {
36183618
"Type getMyClass1_1Type() {\n"
36193619
" return new MyClass1<List<int>, List<double>>().runtimeType;\n"
36203620
"}\n";
3621-
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
3622-
bool instanceOf = false;
3621+
3622+
Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core"));
3623+
EXPECT_VALID(corelib);
36233624

36243625
// First get type objects of some of the basic types used in the test.
3625-
Dart_Handle int_type = Dart_GetType(lib, NewString("int"), 0, NULL);
3626+
Dart_Handle int_type = Dart_GetType(corelib, NewString("int"), 0, NULL);
36263627
EXPECT_VALID(int_type);
3627-
Dart_Handle double_type = Dart_GetType(lib, NewString("double"), 0, NULL);
3628+
Dart_Handle double_type = Dart_GetType(corelib, NewString("double"), 0, NULL);
36283629
EXPECT_VALID(double_type);
3629-
Dart_Handle list_type = Dart_GetType(lib, NewString("List"), 0, NULL);
3630+
Dart_Handle list_type = Dart_GetType(corelib, NewString("List"), 0, NULL);
36303631
EXPECT_VALID(list_type);
36313632
Dart_Handle type_args = Dart_NewList(1);
36323633
EXPECT_VALID(Dart_ListSetAt(type_args, 0, int_type));
36333634
Dart_Handle list_int_type =
3634-
Dart_GetType(lib, NewString("List"), 1, &type_args);
3635+
Dart_GetType(corelib, NewString("List"), 1, &type_args);
36353636
EXPECT_VALID(list_int_type);
36363637

3638+
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
3639+
bool instanceOf = false;
3640+
36373641
// Now instantiate MyClass0 and MyClass1 types with the same type arguments
36383642
// used in the code above.
36393643
type_args = Dart_NewList(2);

0 commit comments

Comments
 (0)