Skip to content

IOS only, Override of a default method generates uncompilable code #4401

@ddyer0

Description

@ddyer0

The base method in an interface is this:

      public default void drawNumber(Graphics gc,PlacementProvider source,PlacementProvider dest,int cellSize,int x,int y,Font font,Color color, String str)
      {	
    	 ...
      	
      }

The override method is this:

    public void drawNumber(Graphics gc,PlacementProvider source,PlacementProvider dest,int cellSize,int x,int y,Font font,Color color, String str)
    {	
    	TruCell cell = (TruCell)dest;
    	int xx = x-cellSize;
    	int yy = y+cellSize;
    	if(cell.lastFlipped>0) {
    	StockArt.SwingCW.drawChip(gc,this,cellSize,xx,yy,null);
    	}
    	else
    	{
    		super.drawNumber(gc,source,dest,cellSize,xx+cellSize,yy-cellSize,font,color, str);
    	}
    }

the compilation error when built is this:

'virtual_online_game_CCanvas_drawNumber___lib_Graphics_online_game_PlacementProvider_online_game_PlacementProvider_int_int_int_com_codename1_ui_Font_bridge_Color_java_lang_String' declared here
 1314 | JAVA_VOID virtual_online_game_CCanvas_drawNumber___lib_Graphics_online_game_PlacementProvider_online_game_PlacementProvider_int_int_int_com_codename1_ui_Font_bridge_Color_java_lang_String(CODENAME_ONE_THREAD_STATE, JAVA_OBJECT  __cn1ThisObject, JAVA_OBJECT __cn1Arg1, JAVA_OBJECT __cn1Arg2, JAVA_OBJECT __cn1Arg3, JAVA_INT __cn1Arg4, JAVA_INT __cn1Arg5, JAVA_INT __cn1Arg6, JAVA_OBJECT __cn1Arg7, JAVA_OBJECT __cn1Arg8, JAVA_OBJECT __cn1Arg9);
      |           ^
1 error generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions