summaryrefslogtreecommitdiff
path: root/test/files/neg/t1980.flags
Commit message (Collapse)AuthorAgeFilesLines
* SI-1980 A lint warning for by-name parameters in right assoc methodsJason Zaugg2013-08-191-0/+1
The desugaring of right associative calls happens in the parser. This eagerly evaluates the arguments (to preserve left-to-right evaluation order the arguments are evaluated before the qualifier). This is pretty surprising if the method being called has a by-name parameter in the first parameter section. This commit adds a warning under -Xlint when defining such a method. The relevent spec snippets: > SLS 4.6.1 says that call-by-name argument "is not evaluated at the point of function application, but instead is evaluated at each use within the function". > > But 6.12.3 offers: > "If op is right- associative, the same operation is interpreted as { val x=e1; e2.op(x ) }, where x is a fresh name."