Ticket #276 (closed defect: fixed)
Overriding Form.ProcessCmdKey causes "no suitable method found to override"
Reported by: | torial | Owned by: | Charles |
---|---|---|---|
Priority: | medium | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: | charles |
Description
When the following code snippet is compiled, I get a "no suitable method found to override".
use System.Windows.Forms #from "System.Windows.Forms" class DataExtractor inherits Form cue init base.init .text = 'SFX' .width = 800 .height = 600 #bug.cobra(16): error: "DataExtractor.ProcessCmdKey(ref System.Windows.Forms.Message?, System.Windows.Forms.Keys)": no suitable method found to override def processCmdKey(msg as inout Message?, keyData as Keys) as bool is override,protected if keyData == Keys.F5 return true return base.processCmdKey(inout msg,keyData) class Program def main is shared has STAThread Application.run(DataExtractor())
However, if I remove the ? and make the Message not nilable, I get an error the indicates it knows about the function:
Cannot make param "msg" non-nil because the base method declares it is nilable. Change "msg" to "Message?", or change the base method.
Change History
Note: See
TracTickets for help on using
tickets.