This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Error with super class android.database.sqlite.SQLiteOpenHelper does not have a default constructor
- From: john janecek <johnpauljanecek at gmail dot com>
- To: kawa at sourceware dot org
- Date: Sun, 16 Nov 2014 08:52:03 +0800
- Subject: Error with super class android.database.sqlite.SQLiteOpenHelper does not have a default constructor
- Authentication-results: sourceware.org; auth=none
The class android.database.sqlite.SQLiteOpenHelper does not have a
default constructor. When I attempt to compile this example it fails.
(require 'android-defs)
(define-alias SQLiteDatabase android.database.sqlite.SQLiteDatabase)
(define-alias SQLiteOpenHelper android.database.sqlite.SQLiteOpenHelper)
(define-alias Context android.content.Context)
(define-simple-class MyDbHelper (SQLiteOpenHelper)
(posts init: '())
((*init* (context ::Context))
(let ((self (this)))
(invoke-special SQLiteOpenHelper
self '*init*
context
"prayers.db"
#!null
1)
))
)
If I look inside the source code of Kawa the error is coming from
/gnu/expr/ClassExp.java:735
void checkDefaultSuperConstructor(
ClassType superClass, Compilation comp) {
if (superClass.getDeclaredMethod("<init>", 0) == null)
comp.error('e', ("super class "+superClass.getName()
+" does not have a default constructor"));
}
But since the class does not have a default constructor the error will
always be triggered. What exactly am I doing wrong ? Thanks.