February 03, 2005 `with' that shouldn't error | ||||
---|---|---|---|---|
| ||||
<code> void main(){ struct Entry{ int variable; } Entry[10] table; with( table[ 1]) variable=0; class Class{ struct Entry{ int variable; } Entry[10] table; Entry opIndex( int inx){ return table[ inx]; } } Class c= new Class; with( c[ 1]) variable= 0; } </code> Should not throw "c.opIndex(1) is not an lvalue". -manfred |
February 12, 2005 Re: `with' that shouldn't error | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manfred Nowak Attachments: | Manfred Nowak wrote: | <code> | void main(){ | struct Entry{ | int variable; | } | Entry[10] table; | | with( table[ 1]) variable=0; | | class Class{ | struct Entry{ | int variable; | } | Entry[10] table; | Entry opIndex( int inx){ | return table[ inx]; | } | } | Class c= new Class; | | with( c[ 1]) variable= 0; | } | </code> | | Should not throw "c.opIndex(1) is not an lvalue". Added to DStress as http://dstress.kuehne.cn/run/with_12.d http://dstress.kuehne.cn/run/with_13.d Thomas |
Copyright © 1999-2021 by the D Language Foundation