Skip to content

[vim9class] problems with method dispatch: super -> abstract -> concrete #15514

@errael

Description

@errael

Steps to reproduce

vim9script

class A
    def ToString()
        echo 'A'
    enddef
endclass

abstract class B extends A
    abstract def ToString()
endclass

class C extends B
    def ToString()
        super.ToString()
    enddef
endclass

C.new().ToString()

Run this and nothing happens.

Expected behaviour

Either A should be output or there should be an error.

Tried this on java, get an error

C.java ... abstract method ToString() in ... B cannot be accessed directly

Version of Vim

9.1.678

Environment

ubuntu/gtk3

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugvim9classVim 9 Class Functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions