-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
Hi,
I've been using D in vscode with code-d extension, now I have an assoc array that I'm trying to initialize where the values are a struct.
Using named arguments in the struct shows so many errors in vscode, (and formatting also seems to be confused) while dmd compiles the code just fine, this is a screenshot.
and full code snippet
struct OperandConstraint
{
OperandKind[] allowedKind;
}
struct InstructionSemaInfo
{
size_t operandCount;
bool allowMemoryToMemory;
bool allowImmAsOperand;
bool srcMustBeMemory;
OperandConstraint[] operandConstraints;
string[] notes;
}
InstructionSemaInfo info = {operandCount: 2};
immutable InstructionSemaInfo[Mnemonic] instructionSemaTable = [
Mnemonic.mov: InstructionSemaInfo(
operandCount : 2,
allowMemoryToMemory:
false,
allowImmAsOperand:
true,
srcMustBeMemory:
false,
operandConstraints:
[
OperandConstraint([OperandKind.register, OperandKind.memory]),
OperandConstraint([
OperandKind.register, OperandKind.memory, OperandKind.imm
]),
],
notes:
[]
),
];
Compiling this with dmd just works
Metadata
Metadata
Assignees
Labels
No labels