I just tried to use the default case in a visit, but get a "java.lang.UnsupportedOperationException". The code below all results in the error.
visit({}) {case {3} : println("a"); default : println("b"); }
visit({}) {default : println("b"); }
visit({}) {default: ; }
According to the tutor, this is correct syntax. What is going wrong here?
The default in a visit is not supported by design, but perhaps that was a mistake? Do you think its useful to have?
Asked: Dec 19 '11
Seen: 20 times
Last updated: Dec 26 '11
Copyright CWI, 2010-2012. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
I had the same problemen, solved it by adding all cases (which is a workaround i guess).
Dennisb (Dec 19 '11)editYou can also add the 'case _', which will always match. But it's still a workaround, not a solution ;)
Johanneke (Dec 19 '11)edit