This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: @Override notations for member functions (e.g. onCreate on Android)
- From: Per Bothner <per at bothner dot com>
- To: Marius Kjeldahl <marius dot kjeldahl at gmail dot com>, kawa at sourceware dot org
- Date: Sun, 23 Feb 2014 11:19:25 -0800
- Subject: Re: @Override notations for member functions (e.g. onCreate on Android)
- Authentication-results: sourceware.org; auth=none
- References: <CAHdMyCLTf7T0wB5y-Q7K+9MjZK3HMK6RGyXkMFWxa8=MO-ttXQ at mail dot gmail dot com>
On 02/23/2014 05:18 AM, Marius Kjeldahl wrote:
I can't seem to get them working, like in the following example:
(define-simple-class MainActivity (android.app.Activity)
((onCreate (savedInstanceState :: android.os.Bundle)) (@Override)
(invoke-special android.app.Activity (this) 'onCreate savedInstanceState)
...)
Are @Override notation supported at all, and if so, how can I use them
on member functions like onCreate?
You need to either write: (@java.lang.Override) or add a:
(define-alias Override java.lang.Override)
Kawa does not automatically "import" java.lang.*. This could
be changed of course.
Note that Kawa currently doesn't check @Override annotations,
and since it has @Retention(SOURCE) it is just ignored.
Making Kawa check @Override annotation seems a worthwhile change.
--
--Per Bothner
per@bothner.com http://per.bothner.com/