Abstract class inheritance

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
wwwoholic
Posts: 53
Joined: 23 December 2010, 20:58 PM

Abstract class inheritance

Post by wwwoholic »

Not sure if this is specific for native mode devices but since I do not work with anything else posting it here.

Code: Select all

public abstract class A
   public abstract sub SetSpeed(byval speed as byte)
   end sub
end class

public abstract class B extends A
end class
When compiled this code produces an error:
Error: class "B" must provide a method with the following signature (see base class "A"): SetSpeed(ByVal as Byte)
The "abstract" declaration on class B should allow the implementation to be delegated to the concrete classes down the chain... at least that's how it is done in other languages.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Abstract class inheritance

Post by dkinzer »

wwwoholic wrote:The "abstract" declaration on class B should allow the implementation to be delegated to the concrete classes down the chain.
You are correct. We'll work on fixing it.
- Don Kinzer
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

We have posted an update that corrects this issue. The update contains the compiler only - it should be extracted to the ZBasic installation directory (copying or renaming the current executable is recommended). The change was fairly simple and preliminary testing suggests that it is correct.
- Don Kinzer
wwwoholic
Posts: 53
Joined: 23 December 2010, 20:58 PM

Post by wwwoholic »

Thanks a lot. This was fast.
Post Reply