Skip to content

Instantly share code, notes, and snippets.

@brycefisher
Created November 30, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brycefisher/48233996d47ee3a05e00 to your computer and use it in GitHub Desktop.
Save brycefisher/48233996d47ee3a05e00 to your computer and use it in GitHub Desktop.
Namespaced Enums
// Enum syntax has changed.
// Given this enum:
enum Shapes {
Circle,
Square
}
// WORKS
let drawing = Shapes::Circle;
// BROKEN:
let drawing = Circle;
// You can make this work by adding a `use Shapes::Circle;` to the top of the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment