Created
January 27, 2022 11:10
-
-
Save Hayao0819/55c304f1618e93f31183afd4da1175ae to your computer and use it in GitHub Desktop.
V Bug about struct and enum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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