我正在groovy中学习enum并使用intellij ide,以下是代码,非常简单,
bind
在intellij想法中运行它,我收到以下错误,
package com.groovy.practice
enum daysOfWeek{Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday}
//println daysOfWeek.values()
Range daysOfWeekRange = daysOfWeek.Sunday..daysOfWeek.Saturday
println daysOfWeekRange.size()
assert daysOfWeekRange.contains(daysOfWeek.Wednesday)
println daysOfWeekRange.getFrom()
println daysOfWeekRange.getTo()
我的Intellij版本是2017.2.3 Groovy Version是groovy-2.6.0-alpha-1。
这个代码在groovyConsole
中工作得非常好有人可以帮忙吗?