-
-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Description
Steps to Reproduce
-
Define a base command object that other command objects extend.
@Validateable
@GrailsCompileStatic
class ApiCommandBase {
String param
...static constraints = { param nullable: true ... }}
-
The extended command object imports the constraints from ApiCommandBase by calling the importFrom method.
@Validateable
@GrailsCompileStatic
class AccountCmd extends ApiCommandBase {
String usernamestatic constraints = { importFrom ApiCommandBase username blank: false }}
Expected Behaviour
The code compiles normally.
Actual Behaviour
This results in the following compilation error:
Compilation error: startup failed:
AccountCmd.groovy: 15: [Static type checking] - Cannot find matching method AccountCmd#importFrom(java.lang.Class <ApiCommandBase>). Please check if the declared type is right and if the method exists.
@ line 15, column 9.
importFrom ApiCommandBase
^
1 error
Environment Information
- Operating System: Mac OSX El Capitan
- Grails Version: 2.5.5
- JDK Version: 1.7
- Container Version (If Applicable): N/A