is this a dmd bug ?
Denis Koroskin
2korden at gmail.com
Tue Nov 24 03:59:04 PST 2009
On Tue, 24 Nov 2009 14:55:44 +0300, 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
Try removing a dot before print.
As is, it searches for a print function at a global scope, fails to find
one and shows an error.
I'm not sure it is a proper behavior, though. Try creating a bugzilla
report.
More information about the Digitalmars-d
mailing list