You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the below match crashes the compiler
it should generate an error instead
Welcome to Scala version 2.10.0-M4 (JavaHotSpot(TM) 64-BitServerVM, Java1.6.0_31).
Type in expressions to have them evaluated.
Type:help for more information.
scala>traitLogLevelType
defined traitLogLevelType
scala>typeLogLevel=IntwithLogLevelType
defined typealiasLogLevel
scala>finalvalErrorLevel=1.asInstanceOf[IntwithLogLevelType]
ErrorLevel:IntwithLogLevelType=1
scala>finalvalWarningLevel=2.asInstanceOf[IntwithLogLevelType]
WarningLevel:IntwithLogLevelType=2
scala>defclassFor(level: LogLevel):Unit= level match {
|caseErrorLevel=> ()
|caseWarningLevel=> ()
| }
The text was updated successfully, but these errors were encountered:
@retronym said (edited on Jun 13, 2012 2:53:06 PM UTC):
For bonus points:
scala>traitLogLevelType
defined traitLogLevelType
scala>typeLogLevel=IntwithLogLevelType
defined typealiasLogLevel
scala>finalvalErrorLevel=1.asInstanceOf[IntwithLogLevelType]
ErrorLevel:IntwithLogLevelType=1
scala>List(ErrorLevel, ErrorLevel)
java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object;
at .<init>(<console>:10)
as for bonus points, I'm not sure I'll get to the boss level this way: when you case to unrealizable types that erase to realizable ones, this is what you had coming
In other words, not sure how to fix this without uprooting lots of stuff in uncurry and erasure. I dug around a bit and it seems the Array-logic in uncurry should be operating on erased types. I'll open a separate ticket.
the below match crashes the compiler
it should generate an error instead
The text was updated successfully, but these errors were encountered: