Odin icon indicating copy to clipboard operation
Odin copied to clipboard

make(T = ..., allocator = ...) crashes the compiler

Open thePHTest opened this issue 3 years ago • 2 comments
trafficstars

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System & Odin Version:
  • Please paste odin report output: Odin: dev-2022-02:cf528431 OS: Windows 10 Professional (version: 21H2), build 19044.1526 CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz RAM: 32705 MiB

Expected Behavior

Compiler won't crash and builds the program.

Current Behavior

Compiler silently crashes.

Failure Information (for bugs)

Capture

Steps to Reproduce

odin build

package map_repro

main :: proc() {
	a_map := make(T = map[i32]u32, allocator = context.allocator)
}

Failure Logs

Please include any relevant log snippets or files here.

thePHTest avatar Feb 14 '22 04:02 thePHTest

From Counter:

seems like you need that specific combination of a generic $T and a defaulted #any_int to make the compiler crash silently foo :: proc($T: typeid, #any_int a := 42) {} foo(T = int)

if you replace $T with T, it will not crash the compiler anymore if you remove the default value from a, it will not crash the compiler anymore if you remove #any_int, it will not crash the compiler anymore

thePHTest avatar Feb 14 '22 19:02 thePHTest

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 22:07 github-actions[bot]