Skip to content

Instantly share code, notes, and snippets.

@Hayao0819
Created January 27, 2022 11:10
Show Gist options
  • Save Hayao0819/55c304f1618e93f31183afd4da1175ae to your computer and use it in GitHub Desktop.
Save Hayao0819/55c304f1618e93f31183afd4da1175ae to your computer and use it in GitHub Desktop.
V Bug about struct and enum
#!/usr/bin/env bash
mkdir "./teststruct"
cat > "./bug-struct.v" << EOF
import teststruct as ts
fn main(){
mut c := ts.Color{
color: ts.ColoList.black
}
println(c)
}
EOF
cat > "./teststruct/main.v" << EOF
module teststruct
pub enum ColorList{
red
blue
green
black
}
pub struct Color{
color ColorList
}
EOF
echo "Now, you can run \"v run ./bug-struct.v\" and see a crach bug."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment