Repository navigation
Inherits
Home › Interfaces › Inherits
Names a class's base class, or the interfaces an interface includes.
class name
inherits base_class
...
end class
interface name
inherits base_interface [ , base_interface ... ]
...
end interfaceinherits is a line at the top of a Class or Interface body. It comes before any member (TKO0435) and, in a class, before the implements lines.
In a class it names the one base class: a class, or a type that extends object. The class starts as a complete object of the base and adds to it, exactly as type D extends B does, and base( … ) in a constructor chooses which base constructor runs. A class with no inherits line extends object. A second base is an error (TKO0427).
In an interface it names other interfaces, as many as needed, on one line or several. Their members become members of this interface, a type that implements it implements them too, and a value of it converts to any of them implicitly. An interface that reaches itself through its inherits lines is an error (TKO1008).
The example on the Class page has a class inheriting a class; the one on the Interface page has an interface inheriting an interface.
- A
typenames its base withextendson its header;inheritsin atypebody is an error that says so (TKO0433). A class names its base withinherits;extendson a class's header is TKO0432. -
inheritsis recognised only as the first word of a line in a class or interface body. Elsewhere it is an ordinary name.
Category: Interfaces Kind: keyword
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing