Community
Participate
Working Groups
When creating a method binding using completion, sometimes a callout override binding is proposed although no role method exists that would be overridden by the callout. The simplest example to reproduce this is public class MyBase { void foo() {} public String toString() { return ""; } } public team class MyTeam { protected class R playedBy MyBase { // complete here and select binding to "foo" } } Moreover, the compiler doesn't actually complain about the bogus "=>" binding token.
Created attachment 170775 [details] test & fix The new test testCompletionCalloutDeclaration1a witnesses why this happened: The sorted array of base method contains "fubar" (the test object) and "toString". When processing this array back to front inspecting "toString" causes kind to be set to CALLOUT_OVERRIDE, which will then be applied to all subsequent proposals, too. Fixed by using a tmp local "curKind".
Patch has been released as r409.
Verified for M4 using build 201006111044
(In reply to comment #3) > Verified for M4 using build 201006111044 OT build was actually 201006111053.