1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix maps with aliases as key (#9900)

This commit is contained in:
ka-weihe
2021-04-28 06:45:21 +02:00
committed by GitHub
parent 4f246222b0
commit 3edbf71770
2 changed files with 20 additions and 7 deletions

View File

@ -606,6 +606,19 @@ fn test_int_keys() {
m3.delete(1)
}
enum Color {
red
green
blue
}
type ColorAlias = Color
fn test_alias_enum() {
mut m := map[ColorAlias]string{}
m[Color.red] = 'hi'
}
fn test_voidptr_keys() {
mut m := map[voidptr]string{}
v := 5