version in enum

Øivind via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 9 04:43:32 PST 2016


Hi,

Why doesn't this work? Seems like it should:

enum {
	A = 1,
	version(xx) {
		B = 2
	}
}

void main() {
	
}


Compilation output:
/d732/f174.d(5): Error: basic type expected, not version
/d732/f174.d(5): Error: no identifier for declarator int
/d732/f174.d(5): Error: if type, there must be an initializer
/d732/f174.d(5): Error: found 'version' when expecting ','
/d732/f174.d(5): Error: basic type expected, not (
/d732/f174.d(5): Error: function declaration without return type. 
(Note that constructors are always named 'this')
/d732/f174.d(5): Error: no identifier for declarator int(xx)
/d732/f174.d(5): Error: if type, there must be an initializer
/d732/f174.d(5): Error: found '{' when expecting ','
/d732/f174.d(8): Error: unrecognized declaration



More information about the Digitalmars-d-learn mailing list