From 934865f44335a78d44887c66e9c7e7ebeb48dcb6 Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Thu, 17 Mar 2022 15:25:32 -0400 Subject: [PATCH] Avoid ambiguity for local method effectively Case 2 in #19352. --- Signed-off-by: Michael Ferguson --- .../generic/poi/check-gc-reuse-opers.chpl | 5 +- .../generic/poi/check-gc-reuse-opers.good | 95 +++++++++---------- 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/test/functions/generic/poi/check-gc-reuse-opers.chpl b/test/functions/generic/poi/check-gc-reuse-opers.chpl index 549f467f830d..af011a5f1db9 100644 --- a/test/functions/generic/poi/check-gc-reuse-opers.chpl +++ b/test/functions/generic/poi/check-gc-reuse-opers.chpl @@ -58,8 +58,9 @@ module User { } } proc u3() { - proc MyRecord.init(param p) { note("u3.init", 2); rp = 0; } - proc MyRecord.init=(other) { note("u3.init=", 2); rp = 0; } + // having these methods here would lead to ambiguity -- see #19352 + //proc MyRecord.init(param p) { note("u3.init", 2); rp = 0; } + //proc MyRecord.init=(other) { note("u3.init=", 2); rp = 0; } operator =(ref lhs:MyRecord, rhs:MyRecord) { note("u3.=", 2); } operator <(lhs:MyRecord, rhs:MyRecord) { note("u3.<", 2); return true; } diff --git a/test/functions/generic/poi/check-gc-reuse-opers.good b/test/functions/generic/poi/check-gc-reuse-opers.good index ed4fe7d6840a..52a5422d59e7 100644 --- a/test/functions/generic/poi/check-gc-reuse-opers.good +++ b/test/functions/generic/poi/check-gc-reuse-opers.good @@ -21,84 +21,79 @@ check-gc-reuse-opers.chpl:27: warning: User._castT check-gc-reuse-opers.chpl:49: In function 'u2': check-gc-reuse-opers.chpl:51: warning: User.u2 check-gc-reuse-opers.chpl:60: In function 'u3': -check-gc-reuse-opers.chpl:69: warning: User.u3 -check-gc-reuse-opers.chpl:23: In function 'libIE': -check-gc-reuse-opers.chpl:23: warning: u3.init= - check-gc-reuse-opers.chpl:71: called as libIE(myArg: int(64)) +check-gc-reuse-opers.chpl:70: warning: User.u3 check-gc-reuse-opers.chpl:24: In function 'libAS': check-gc-reuse-opers.chpl:24: warning: u3.= - check-gc-reuse-opers.chpl:72: called as libAS(myArg: int(64)) + check-gc-reuse-opers.chpl:73: called as libAS(myArg: int(64)) check-gc-reuse-opers.chpl:25: In function 'libLT': check-gc-reuse-opers.chpl:25: warning: u3.< - check-gc-reuse-opers.chpl:73: called as libLT(myArg: int(64)) + check-gc-reuse-opers.chpl:74: called as libLT(myArg: int(64)) check-gc-reuse-opers.chpl:26: In function 'libCF': check-gc-reuse-opers.chpl:26: warning: u3._castF - check-gc-reuse-opers.chpl:74: called as libCF(myArg: int(64)) + check-gc-reuse-opers.chpl:75: called as libCF(myArg: int(64)) check-gc-reuse-opers.chpl:27: In function 'libCT': check-gc-reuse-opers.chpl:27: warning: u3._castT - check-gc-reuse-opers.chpl:75: called as libCT(myArg: int(64)) -check-gc-reuse-opers.chpl:60: In function 'u3': -check-gc-reuse-opers.chpl:68: warning: u3.init -check-gc-reuse-opers.chpl:114: In function 'm1con': -check-gc-reuse-opers.chpl:115: warning: More1.m1con + check-gc-reuse-opers.chpl:76: called as libCT(myArg: int(64)) +check-gc-reuse-opers.chpl:115: In function 'm1con': +check-gc-reuse-opers.chpl:116: warning: More1.m1con check-gc-reuse-opers.chpl:23: In function 'libIE': check-gc-reuse-opers.chpl:23: warning: More1.init= - check-gc-reuse-opers.chpl:117: called as libIE(myArg: int(64)) + check-gc-reuse-opers.chpl:118: called as libIE(myArg: int(64)) check-gc-reuse-opers.chpl:24: In function 'libAS': check-gc-reuse-opers.chpl:24: warning: More1.= - check-gc-reuse-opers.chpl:118: called as libAS(myArg: int(64)) + check-gc-reuse-opers.chpl:119: called as libAS(myArg: int(64)) check-gc-reuse-opers.chpl:25: In function 'libLT': check-gc-reuse-opers.chpl:25: warning: More1.< - check-gc-reuse-opers.chpl:119: called as libLT(myArg: int(64)) + check-gc-reuse-opers.chpl:120: called as libLT(myArg: int(64)) check-gc-reuse-opers.chpl:26: In function 'libCF': check-gc-reuse-opers.chpl:26: warning: More1._castF - check-gc-reuse-opers.chpl:120: called as libCF(myArg: int(64)) + check-gc-reuse-opers.chpl:121: called as libCF(myArg: int(64)) check-gc-reuse-opers.chpl:27: In function 'libCT': check-gc-reuse-opers.chpl:27: warning: More1._castT - check-gc-reuse-opers.chpl:121: called as libCT(myArg: int(64)) -check-gc-reuse-opers.chpl:112: In function ':': -check-gc-reuse-opers.chpl:113: warning: More1.init + check-gc-reuse-opers.chpl:122: called as libCT(myArg: int(64)) +check-gc-reuse-opers.chpl:113: In function ':': +check-gc-reuse-opers.chpl:114: warning: More1.init check-gc-reuse-opers.chpl:27: called as :(rhs: int(64), type t = MyRecord) from function 'libCT' - check-gc-reuse-opers.chpl:121: called as libCT(myArg: int(64)) -check-gc-reuse-opers.chpl:123: In function 'm1gen': -check-gc-reuse-opers.chpl:124: warning: More1.m1gen - check-gc-reuse-opers.chpl:85: called as m1gen(param p = 0) -check-gc-reuse-opers.chpl:137: In function 'm2con': -check-gc-reuse-opers.chpl:138: warning: More2.m2con -check-gc-reuse-opers.chpl:141: In function 'm2gen': -check-gc-reuse-opers.chpl:142: warning: More2.m2gen - check-gc-reuse-opers.chpl:90: called as m2gen(param p = 0) -check-gc-reuse-opers.chpl:180: In function 'combo2a': -check-gc-reuse-opers.chpl:181: warning: Combo2.combo2a - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) + check-gc-reuse-opers.chpl:122: called as libCT(myArg: int(64)) +check-gc-reuse-opers.chpl:124: In function 'm1gen': +check-gc-reuse-opers.chpl:125: warning: More1.m1gen + check-gc-reuse-opers.chpl:86: called as m1gen(param p = 0) +check-gc-reuse-opers.chpl:138: In function 'm2con': +check-gc-reuse-opers.chpl:139: warning: More2.m2con +check-gc-reuse-opers.chpl:142: In function 'm2gen': +check-gc-reuse-opers.chpl:143: warning: More2.m2gen + check-gc-reuse-opers.chpl:91: called as m2gen(param p = 0) +check-gc-reuse-opers.chpl:181: In function 'combo2a': +check-gc-reuse-opers.chpl:182: warning: Combo2.combo2a + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) check-gc-reuse-opers.chpl:23: In function 'libIE': check-gc-reuse-opers.chpl:23: warning: Combo1.init= - check-gc-reuse-opers.chpl:183: called as libIE(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) + check-gc-reuse-opers.chpl:184: called as libIE(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) check-gc-reuse-opers.chpl:24: In function 'libAS': check-gc-reuse-opers.chpl:24: warning: Combo1.= - check-gc-reuse-opers.chpl:184: called as libAS(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) + check-gc-reuse-opers.chpl:185: called as libAS(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) check-gc-reuse-opers.chpl:25: In function 'libLT': check-gc-reuse-opers.chpl:25: warning: Combo1.< - check-gc-reuse-opers.chpl:185: called as libLT(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) + check-gc-reuse-opers.chpl:186: called as libLT(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) check-gc-reuse-opers.chpl:26: In function 'libCF': check-gc-reuse-opers.chpl:26: warning: Combo1._castF - check-gc-reuse-opers.chpl:186: called as libCF(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) + check-gc-reuse-opers.chpl:187: called as libCF(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) check-gc-reuse-opers.chpl:27: In function 'libCT': check-gc-reuse-opers.chpl:27: warning: Combo1._castT - check-gc-reuse-opers.chpl:187: called as libCT(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) -check-gc-reuse-opers.chpl:160: In function ':': -check-gc-reuse-opers.chpl:161: warning: Combo1.init + check-gc-reuse-opers.chpl:188: called as libCT(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) +check-gc-reuse-opers.chpl:161: In function ':': +check-gc-reuse-opers.chpl:162: warning: Combo1.init check-gc-reuse-opers.chpl:27: called as :(rhs: int(64), type t = MyRecord) from function 'libCT' - check-gc-reuse-opers.chpl:187: called as libCT(myArg: int(64)) from function 'combo2a' - check-gc-reuse-opers.chpl:164: called as combo2a(param p = 0) -check-gc-reuse-opers.chpl:166: In function 'combo1b': -check-gc-reuse-opers.chpl:167: warning: Combo1.combo1b - check-gc-reuse-opers.chpl:191: called as combo1b(param p = 0) + check-gc-reuse-opers.chpl:188: called as libCT(myArg: int(64)) from function 'combo2a' + check-gc-reuse-opers.chpl:165: called as combo2a(param p = 0) +check-gc-reuse-opers.chpl:167: In function 'combo1b': +check-gc-reuse-opers.chpl:168: warning: Combo1.combo1b + check-gc-reuse-opers.chpl:192: called as combo1b(param p = 0) User.u1 User.init @@ -120,12 +115,12 @@ User.init User.u3 User.init -u3.init= +User.init= u3.= u3.< u3._castF u3._castT -u3.init +User.init More1.m1con User.init