atilaneves / cerealed

Powerful binary serialisation library for D
BSD 3-Clause "New" or "Revised" License
92 stars 3 forks source link

Error: variable length used before set #16

Closed gchatelet closed 7 years ago

gchatelet commented 7 years ago

with DMD64 D Compiler v2.075.0

struct Sample {}
void main(string[] args) {
  import cerealed;
  import std.file : read;
  const(ubyte)[] bytes = cast(const(ubyte)[])(read("samples.dat"));
  bytes.decerealise!(Sample[]);
}
../../.dub/packages/cerealed-0.6.8/cerealed/src/cerealed/cereal.d(192,18): Error: variable length used before set

Did I miss something?

gchatelet commented 7 years ago

Actually it works just fine when removing dub's --build=release so I guess it's a dmd issue?

atilaneves commented 7 years ago

The message comes from the dmd back end - it's probably a bug, but I've found a workaround for now.

gchatelet commented 7 years ago

Thx for the quick fix!