It seems like the following situation makes SyntaxError Try to call method which same name of local variable exists, without parenthesis Argument part contains colon (':') All the following test cases contain empty method definition, but it's not required (if you omit it, the expected result is NoMethodError instead of SyntaxError) ng_assoc.rb¶ def var(h); end var = 1 var :a => :b ruby 2.3.0dev (2