@@ -831,9 +831,10 @@ TEST(cross_language_config_caller_drops_unique_name_too) {
831831 cbm_suppress_cross_language_suffix_match (CBM_LANG_CMAKE , "src/main.c" , "unique_name" ));
832832 ASSERT_TRUE (
833833 cbm_suppress_cross_language_suffix_match (CBM_LANG_YAML , "app/models.py" , "unique_name" ));
834- /* A code caller's unique_name into another language is still #1572. */
835- ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (
836- CBM_LANG_PYTHON , "web/src/pages/Editor.js" , "unique_name" ));
834+ /* A code caller's unique_name into another language is #1572. */
835+ ASSERT_TRUE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON ,
836+ "web/src/pages/Editor.js" ,
837+ "unique_name" ));
837838 /* Same-language config targets are untouched. */
838839 ASSERT_FALSE (
839840 cbm_suppress_cross_language_suffix_match (CBM_LANG_MAKEFILE , "lib/Makefile" , "unique_name" ));
@@ -912,7 +913,7 @@ TEST(registry_tie_break_is_independent_of_registration_order) {
912913
913914TEST (cross_language_suffix_match_drops_py_vs_js ) {
914915 /* #725: two same-named symbols in different languages. suffix_match is the
915- * strategy that collapses them; unique_name is #1572 and must stay . */
916+ * strategy that collapses them. unique_name is covered by the #1572 test . */
916917 ASSERT_TRUE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "web/src/pages/Editor.js" ,
917918 "suffix_match" ));
918919 ASSERT_TRUE (
@@ -921,8 +922,6 @@ TEST(cross_language_suffix_match_drops_py_vs_js) {
921922 cbm_suppress_cross_language_suffix_match (CBM_LANG_BASH , "cli/main.py" , "suffix_match" ));
922923 ASSERT_FALSE (
923924 cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "store.py" , "suffix_match" ));
924- ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (
925- CBM_LANG_PYTHON , "web/src/pages/Editor.js" , "unique_name" ));
926925 ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (
927926 CBM_LANG_PYTHON , "web/src/pages/Editor.js" , "same_module" ));
928927 ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON ,
@@ -987,6 +986,36 @@ TEST(go_bare_ref_never_binds_field) {
987986 PASS ();
988987}
989988
989+ TEST (cross_language_unique_name_drops_py_vs_tsx ) {
990+ /* #1572: unique_name is the candidates==1 case of the same class as
991+ * suffix_match. Python `from unittest.mock import patch` must not bind
992+ * to a unique TSX `function patch`. */
993+ ASSERT_TRUE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "frontend/Panel.tsx" ,
994+ "unique_name" ));
995+ ASSERT_TRUE (cbm_suppress_cross_language_suffix_match (CBM_LANG_TSX , "backend/test_thing.py" ,
996+ "unique_name" ));
997+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "backend/test_thing.py" ,
998+ "unique_name" ));
999+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "frontend/Panel.tsx" ,
1000+ "same_module" ));
1001+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "frontend/Panel.tsx" ,
1002+ "import_map" ));
1003+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_PYTHON , "frontend/Panel.tsx" ,
1004+ "lsp_direct" ));
1005+ /* JS/TS/TSX are one family — a .ts caller of a .tsx unique_name stays. */
1006+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_TYPESCRIPT , "frontend/Panel.tsx" ,
1007+ "unique_name" ));
1008+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_JAVASCRIPT , "frontend/Panel.tsx" ,
1009+ "unique_name" ));
1010+ /* C/C++, JVM, and Vue→TS families stay exempt for unique_name. */
1011+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_C , "bpf/probe.h" , "unique_name" ));
1012+ ASSERT_FALSE (
1013+ cbm_suppress_cross_language_suffix_match (CBM_LANG_GROOVY , "buildSrc/Foo.java" , "unique_name" ));
1014+ ASSERT_FALSE (cbm_suppress_cross_language_suffix_match (CBM_LANG_VUE , "services/Queue.ts" ,
1015+ "unique_name" ));
1016+ PASS ();
1017+ }
1018+
9901019TEST (dynamic_suppress_drops_weak_method_matches ) {
9911020 /* #592/#606/#1276: a member call whose receiver the LSP could not type, that
9921021 * landed via a WEAK short-name strategy, is generic-resolver noise → drop.
@@ -1244,6 +1273,7 @@ SUITE(registry) {
12441273 RUN_TEST (registry_tie_break_is_independent_of_registration_order );
12451274 RUN_TEST (cross_language_ref_drops_go_vs_c );
12461275 RUN_TEST (go_bare_ref_never_binds_field );
1276+ RUN_TEST (cross_language_unique_name_drops_py_vs_tsx );
12471277 RUN_TEST (dynamic_suppress_drops_weak_method_matches );
12481278 RUN_TEST (dynamic_suppress_keeps_high_confidence_and_non_methods );
12491279 RUN_TEST (python_builtin_member_table_matches_builtin_type_methods );
0 commit comments