Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using named arguments to specify the capacity of make when allocating a map fails in dev-2024-12 #4618

Open
PucklaJ opened this issue Dec 24, 2024 · 0 comments

Comments

@PucklaJ
Copy link
Contributor

PucklaJ commented Dec 24, 2024

Context

When updating to dev-2024-12 and then building my code. Errors showed up where I was using a named argument to specify the capacity of make when allocating a map.

  • Operating System & Odin Version:
  • Please paste odin report output:

Odin: dev-2024-12:7be003557
OS: Arch Linux ARM, Linux 6.9.3-3-MANJARO-ARM
CPU: ARM64
RAM: 3862 MiB
Backend: LLVM 18.1.8

Expected Behavior

The following code should compile completely fine:

package main

import "core:fmt"

main :: proc() {
	v := make(map[string]string, capacity = 15, allocator = context.allocator)
	defer delete(v)

	v["foo"] = "bar"

	fmt.printfln("{}={}", "foo", v["foo"])
}

Current Behavior

But it fails with the following message:

Error: Parameter 'capacity' of type 'int' is missing in procedure call 
        v := make(map[string]string, capacity = 15, allocator = cont ... 
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... 

Failure Information (for bugs)

Oddly enough when using make_map_cap instead of make it works completely fine.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Build and install odin dev-2024-12´
  2. odin run the provided code
  3. See that it does not compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant