is this a dmd bug ?

Steven Schveighoffer schveiguy at yahoo.com
Tue Nov 24 04:03:57 PST 2009


On Tue, 24 Nov 2009 06:55:44 -0500, Long Chang <changedalone at gmail.com>  
wrote:

> public interface Listener {
>     void handleEvent (int);
> }
>
> void main(){
>     void print(int evt){
>
>     }
>     Listener listener    = new class() Listener {
>         public void handleEvent(int evt) {
>             .print(evt);
>         }
>     };
> }
>
> -----------------------------------------------------------------------------------
> x.d(20): Error: undefined identifier module x.print
> x.d(20): Error: function expected before (), not module x.print of type  
> void

It's the . before the print.  It means "only look in the global scope".

-Steve



More information about the Digitalmars-d mailing list