
|
If you were logged in you would be able to see more operations.
|
|
|
Boo
Created: 30/Oct/05 01:47 PM
Updated: 23/Nov/05 02:54 PM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
0.7.5
|
|
|
Issue Links:
|
Duplicate
|
|
This issue duplicates:
|
|
BOO-361
assert can be confused by comment with some assertion types
|
|
|
|
|
|
|
|
>>> if true:
... print 'good'
...
good
>>> if 5 in [1, 2, 3, 4, 5]:
... print 'good'
...
good
>>> if true and 5 in [1, 2, 3, 4, 5]:
... print 'good'
...
good
>>> if 5 in [1, 2, 3, 4, 5] and true:
... print 'good'
...
System.MissingMethodException: Method System.Int32.op_Member not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator(String operatorName, Object lhs, Object rhs)
at Input6Module.Main(String[] argv)
This happens if you compile with booc as well.
|
|
Description
|
>>> if true:
... print 'good'
...
good
>>> if 5 in [1, 2, 3, 4, 5]:
... print 'good'
...
good
>>> if true and 5 in [1, 2, 3, 4, 5]:
... print 'good'
...
good
>>> if 5 in [1, 2, 3, 4, 5] and true:
... print 'good'
...
System.MissingMethodException: Method System.Int32.op_Member not found.
at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
at Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator(String operatorName, Object lhs, Object rhs)
at Input6Module.Main(String[] argv)
This happens if you compile with booc as well. |
Show » |
|
r=array_or_expression
to
r=sum
it will fix the precedence issue, but then this syntax will not work:
c = 2 in 1,2,3
It gets parsed as:
c = (2 in 1), 2, 3
which generates a compiler error.
c = 2 in (1,2,3)
still works as expected though and does what you want.
So question is should support for this be dropped/made incorrect:
c = 2 in 1,2,3