Shouldn't this work? According to "Static Initialization of AAs" on this page, it should: https://dlang.org/spec/hash-map.html

enum DevicePropDataType {
  dString,
  dDateTime
}

enum DevicePropValType {
  property,
  miscDate
}

immutable DevicePropDataType[DevicePropValType] propDType =
  [
DevicePropValType.property: DevicePropDataType.dString, DevicePropValType.miscDate: DevicePropDataType.dDateTime
   ];

void main() {
        
}

I get the following error:
/d847/f751.d(12): Error: non-constant expression [cast(DevicePropValType)0:cast(DevicePropDataType)0, cast(DevicePropValType)1:cast(DevicePropDataType)1]

Reply via email to