Mono-D icon indicating copy to clipboard operation
Mono-D copied to clipboard

Semicolon attributes should span the whole scope

Open etcimon opened this issue 11 years ago • 6 comments

example:

import std.stdio;

version(Something):
class A {
        static void print() { writeln("ACTIVE"); };
}

public:
void main() {
        writeln(A.print());
}

The compiler doesn't find main() here but it's not grayed out

etcimon avatar Oct 24 '14 14:10 etcimon

Where's the cursor where it can't find the main method?

aBothe avatar Oct 24 '14 18:10 aBothe

The problem is that it's not entirely grayed out. The graying stops at public: currently, wherever the cursor is

etcimon avatar Oct 24 '14 20:10 etcimon

Hold on, so the scope of version(Something) is the entire following code below this attribute? Hmm.

aBothe avatar Oct 24 '14 21:10 aBothe

Yes, my example shows this because the main won't show up in the executable.

etcimon avatar Oct 24 '14 21:10 etcimon

but wait, if there's a new version-condition, the old one becomes overwritten, right?

aBothe avatar Oct 24 '14 21:10 aBothe

Please try v2.5.2 - although an eventually occurring version(all) does not 'undo' the version(something), it should work better now

aBothe avatar Oct 24 '14 22:10 aBothe