[cfe-commits] r104023 - in /cfe/trunk: lib/Sema/SemaLookup.cpp test/FixIt/typo.m

Douglas Gregor dgregor at apple.com
Tue May 18 10:19:25 PDT 2010



Sent from my iPhone

On May 18, 2010, at 9:40 AM, Chris Lattner <clattner at apple.com> wrote:

> 
> On May 18, 2010, at 9:30 AM, Douglas Gregor wrote:
> 
>> Author: dgregor
>> Date: Tue May 18 11:30:22 2010
>> New Revision: 104023
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=104023&view=rev
>> Log:
>> Give a slight edge to the context-sensitive keyword 'super' over
>> non-function-local declarations with names similar to what the user
>> typed. For example, this allows us to correct 'supper' to 'super' in
>> an Objective-C message send, even though the C function 'isupper' has
>> the same edit distance.
> 
> This is clearly the right thing to do.  However, I wonder if isupper should also be punished because it's type doesn't make sense as a receiver of an objc message.  While objc is pretty "loose" when it comes to allowing arbitrary pointer types as receivers, the spell check logic could assume or heavily bias the receivers with types that make sense.

I agree, to an extent. Isupper could be the first part of a more interesting receiver expression (say, a ternary operator), so there's a balance between "what usually makes sense" and "what could happen" that I'd like to explore more generally. 



More information about the cfe-commits mailing list