Reputation:
It's my class
module figure;
import block;
class Figure {
Block[] body;
this() {
this.body ~= new Block();
}
}
And I got "no identifier for declarator Block[]"
Block.d file
module block;
import std.stdio;
class Block {
this() {
writeln("In block.d");
}
}
Upvotes: 2
Views: 102
Reputation: 25605
Oh, the word body
is a keyword in D and thus cannot be used as a variable name. Try just about any other name, maybe body_
or just blocks
or almost anything else and it will work.
Upvotes: 5