-
-
Notifications
You must be signed in to change notification settings - Fork 271
Open
Description
Compiles fine in 1.41.0
// LDC2 1.42.0 LLVM bug minimal reproduction
// Compile: ldc2 --preview=dip1000 standalone_test.d
// Error: "Referring to an instruction in another function!" + "LLVM ERROR: Broken module"
module standalone_test;
struct Column { string name; }
struct Table { Column[string] columns; }
struct Schema { Table[string] tables; }
struct Database(int E) { Schema[string] schemas; }
auto makeDB() => immutable Database!1(["s": immutable Schema(["t": immutable Table(["c": immutable Column("c")])])]);
enum immutable(Schema) schema = makeDB().schemas["s"];
struct S(const Schema s) {
auto f(string x)() {
static string g() { return (*("t" in s.tables)).columns.length > 0 ? "y" : "n"; }
enum v = g();
return R();
}
struct R { string front() => ""; }
}
alias Row = typeof(S!schema().f!"x".front);
void main() {}
Metadata
Metadata
Assignees
Labels
No labels