@@ -1002,8 +1002,8 @@ TEST(LLVMCodeAnalyzer_ListTypeAnalysis, CrossListDependency_SingleType)
10021002 // targetList first write has no previous type
10031003 ASSERT_EQ (appendList1_1->targetType , Compiler::StaticType::Void);
10041004
1005- // targetList second write has Number type
1006- ASSERT_EQ (appendList1_2->targetType , Compiler::StaticType::Number);
1005+ // targetList second write has Number | String type (get list item can always return string)
1006+ ASSERT_EQ (appendList1_2->targetType , Compiler::StaticType::Number | Compiler::StaticType::String );
10071007}
10081008
10091009TEST (LLVMCodeAnalyzer_ListTypeAnalysis, CrossListDependency_MultipleTypes)
@@ -1063,8 +1063,8 @@ TEST(LLVMCodeAnalyzer_ListTypeAnalysis, CrossListDependency_MultipleTypes)
10631063 // targetList first write has no previous type
10641064 ASSERT_EQ (appendList3->targetType , Compiler::StaticType::Void);
10651065
1066- // targetList second write has Number or Bool type
1067- ASSERT_EQ (appendList4->targetType , Compiler::StaticType::Number | Compiler::StaticType::Bool );
1066+ // targetList second write has Number or Bool type + String (get list item can always return string)
1067+ ASSERT_EQ (appendList4->targetType , Compiler::StaticType::Unknown );
10681068}
10691069
10701070TEST (LLVMCodeAnalyzer_ListTypeAnalysis, ChainedAssignmentsInLoop)
@@ -1243,8 +1243,8 @@ TEST(LLVMCodeAnalyzer_ListTypeAnalysis, ListReadReturnRegType)
12431243
12441244 analyzer.analyzeScript (list);
12451245
1246- // sourceList read return register has Number type
1247- ASSERT_EQ (sourceValue.type (), Compiler::StaticType::Number);
1246+ // sourceList read return register has Number | String type (get list item can always return string)
1247+ ASSERT_EQ (sourceValue.type (), Compiler::StaticType::Number | Compiler::StaticType::String );
12481248}
12491249
12501250TEST (LLVMCodeAnalyzer_ListTypeAnalysis, CrossListWriteArgType)
@@ -1285,6 +1285,6 @@ TEST(LLVMCodeAnalyzer_ListTypeAnalysis, CrossListWriteArgType)
12851285
12861286 analyzer.analyzeScript (list);
12871287
1288- // last write argument has Number type
1289- ASSERT_EQ (appendList1_1->args .back ().first , Compiler::StaticType::Number);
1288+ // last write argument has Number | String type (get list item can always return string)
1289+ ASSERT_EQ (appendList1_1->args .back ().first , Compiler::StaticType::Number | Compiler::StaticType::String );
12901290}
0 commit comments