Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Range being flagged as "duplicate"

Open RaphGL opened this issue 10 months ago • 2 comments

Context

Using a range in a switch is being flagged as duplicate by the compiler. I found this out while trying to check some unicode codepoints.

  • Arch Linux x86
  • odin version dev-2024-12:7be003557 (but I've been told that it's failing even on master branch)

Failure Information (for bugs)

/home/raph/Projects/OdinKDL2/helpers.odin(28:15) Error: Duplicate case ''\uDFFF'' 
    previous case at /home/raph/Projects/OdinKDL2/helpers.odin(28:4) 
    ... D800'..='\uDFFF'

Steps to Reproduce

Compile the following code and it will throw an error:

package main 

foo :: proc(r: rune) {
    switch r {
    case '\uD800'..='\uDFFF':
    }
}

RaphGL avatar Dec 24 '24 17:12 RaphGL