This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Error with super class android.database.sqlite.SQLiteOpenHelper does not have a default constructor


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]