grails-浮动的最小/最大约束失败?

grails-浮动的最小/最大约束失败?,grails,constraints,gorm,Grails,Constraints,Gorm,我有这门课: class SomeClass { float percent static constraints = { percent(min:1.0F, max:100.0F) } } 当我启动应用程序时,会出现以下错误: Parameter for constraint [min] of property [percent] of class [class SomeClass] must be the same type as propert

我有这门课:

class SomeClass {

    float percent

    static constraints = {
        percent(min:1.0F, max:100.0F)
    }
}
当我启动应用程序时,会出现以下错误:

Parameter for constraint [min] of property [percent] of class [class SomeClass] must be the same type as property: [float]

这是一个bug还是我做错了什么?

我认为你应该使用small
f
而不是
f

static constraints = {
    percent(min:1.0f, max:100.0f)
}


尝试将
百分比
的类型更改为
浮动
,那么1.0F应该是有效的

这是我第一次尝试的。结果是一样的。我在文档中发现了一个带有大号字母F的示例-这就是我这样写的原因尝试将
percent
的类型更改为
Float
,然后
1.0F
应该是有效的