Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created June 5, 2010 02:11
Show Gist options
  • Save kmizu/426220 to your computer and use it in GitHub Desktop.
Save kmizu/426220 to your computer and use it in GitHub Desktop.
-- Scala --
object X extends Enumeration { val A, B, C = Value }
object Y extends Enumeration { val A, B, C = Value }
var x: X.Value = X.A // これはOK
x = Y.A これはダメ
同じように
-- Java --
enum X { A, B, C }
enum Y { A, B, C }
...
X x = X.A; // これはOk
x = Y.A // これはダメ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment