我有一个具有两个重载方法的 Android-Java 类
package com.test;
public class A{
public void theMethod(Bitmap bitmap){
...
}
public void theMethod(int resource){
...
}
}
我正在尝试在Nativescript-Angular程序中扩展该类:
class ExtendedA extends com.test.A{
public theMethod(bitmap : android.graphics.Bitmap) : void{
...
}
}
但我有这个错误
Property 'theMethod' in type 'ExtendedA' is not assignable to the same property in base type ‘A’.
Type ‘(bitmap : Bitmap) => void' is not assignable to type '{ (param: Bitmap): void; (param : number): void; }'.
Types of parameters 'bitmap' and 'param' are incompatible.
Type 'number' is not assignable to type 'Bitmap'.
PD 我没有 com.test.A 类的代码。
冉冉说
相关分类