From: "Abinoam Jr." Date: 2011-01-18T07:56:25+09:00 Subject: Re: Obscure syntax error > I think the explanation is simple: you (most likely) found a bug in the parser. > > You should report this to ruby-core@ In my humble opinion I think it's even simpler than that. Sorry if I'm wrong, but... If you have an object (expression returning an object reference) what are the syntactic constructs allowed after that? When the variable is not defined the parser can think that it is a method name (an undefined method error) and the "Symbol" is an argument. But, when it is defined, it returns an object, and the colon is not allowed syntactically in this context. I just couldn't figure out why using constants renders different behavior. Look nil is an object. Try this: nil:y nil :y nil: y nil : y nil : y class A; end a = A.new a:y a :y a: y a : y A:y (No Method) A :y (No Method) A: y A : y Only "A:y" and "A :y" raises a Method error. The others, all of them raises Syntax error. (tested against ruby 1.9). Abinoam Jr.