odin-lang/Odin

src/ir.cpp(6290): Panic: NOT FOUND ir_type_info_index u64 @ index 98

oskarnp opened this issue · 0 comments

  • Operating System: macOS Catalina 10.15.5
  • Odin version/Commit: cbfe357

The following code causes internal panic in compiler. However, adding the fmt.println() avoids the panic and works.

package bug

import "core:fmt"

Polygon :: struct {
	width, height: int,
	derived: any,
}

Triangle :: struct {
	using base: Polygon,
}

main :: proc() {
	triangle := new(Triangle);
	triangle.derived = triangle;
	triangle.width = 4;
	triangle.height = 5;

	assert(triangle.width == 4);

	// src/ir.cpp(6290): Panic: NOT FOUND ir_type_info_index u64 @ index 98

	// Comment out print to get rid of the panic.
	// fmt.println(triangle.width);
}