enhancements on RoninTemplate not visible at runtime?

3 views
Skip to first unread message

chris

unread,
Jul 24, 2012, 10:54:55 AM7/24/12
to ronin...@googlegroups.com
1. create a new ronin app following the quick install instructions on the web site
2. create a new enhancement:
   enhancement RoninTemplateEnhancement: ronin.RoninTemplate {
  function test() : String {
    return "Test"
  }
}
3. update Main.gst to extend RoninTemplate and add a call to ${test()} somewhere

In IJ everything verifies and looks good. Run vark server and go to http://localhost:8080 you get the following error:
An Exception Occurred:
Message: RoninTemplate.gs Errors: No function defined for test. [line:-227 col:15] in line 1: Expected Type: String Line Number: 3 Column: 15 Warnings: The type String is already assignable to String, so coercing is unnecessary.

What am I doing wrong?

Thanks

Chris






Gus Prevas

unread,
Jul 24, 2012, 10:56:58 AM7/24/12
to ronin...@googlegroups.com
I suspect the mechanism by which templates "inherit" methods from their "superclass" doesn't pick up enhancement methods.  I'd recommend instead creating a subclass of RoninTemplate and having your templates "extend" that class.

Carson Gross

unread,
Jul 24, 2012, 10:58:33 AM7/24/12
to ronin...@googlegroups.com
Make the function static.  Stupid, but that's the way it is right now.

Not sure why it is verifying in IJ, that's a bug.

Cheers,
Carson

Chris Gow

unread,
Jul 24, 2012, 11:06:10 AM7/24/12
to ronin...@googlegroups.com
In order to get it to verify I have to restart IJ after using the
enhancement in my page

Thanks guys!
Reply all
Reply to author
Forward
0 new messages