[vim/vim] base class method called with :defer (Issue #11910)

5 views
Skip to first unread message

errael

unread,
Jan 29, 2023, 3:20:27 PM1/29/23
to vim/vim, Subscribed

Steps to reproduce

Add the following to test_vim9_class.vim::Text_defer_with_object
It fails with line 32: Expected 'entered-child/called/exited-child' but got 'entered-child/called/exited-base'

  lines =<< trim END
      vim9script

      class BaseWithEE
        def Enter()
          g:result ..= "entered-base/"
        enddef
        def Exit()
          g:result ..= "exited-base"
        enddef
      endclass

      class CWithEE extends BaseWithEE
        def Enter()
          g:result ..= "entered-child/"
        enddef
        def Exit()
          g:result ..= "exited-child"
        enddef
      endclass

      def With(ee: BaseWithEE, F: func)
        ee.Enter()
        defer ee.Exit()
        F()
      enddef

      g:result = ''
      var obj = CWithEE.new()
      obj->With(() => {
        g:result ..= "called/"
      })
      assert_equal('entered-child/called/exited-child', g:result)
      unlet g:result
  END
  v9.CheckScriptSuccess(lines)

Expected behaviour

No failure

Version of Vim

9.0.1261

Environment

ubuntu

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11910@github.com>

Bram Moolenaar

unread,
Feb 8, 2023, 3:56:30 PM2/8/23
to vim/vim, Subscribed

Closed #11910 as completed via 313e472.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/11910/issue_event/8472945243@github.com>

Reply all
Reply to author
Forward
0 new messages