mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 9.0.1605: crash when calling method on super in child constructor
Problem: Crash when calling method on super in child constructor. (Israel Chauca Fuentes) Solution: Clear the type list. (Ernie Rael, closes #12489, closes #12471)
This commit is contained in:
committed by
Bram Moolenaar
parent
abc8130d6a
commit
114ec813b3
@@ -1636,6 +1636,28 @@ def Test_using_base_class()
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
unlet g:result
|
||||
|
||||
# Using super, Child invokes Base method which has optional arg. #12471
|
||||
lines =<< trim END
|
||||
vim9script
|
||||
|
||||
class Base
|
||||
this.success: bool = false
|
||||
def Method(arg = 0)
|
||||
this.success = true
|
||||
enddef
|
||||
endclass
|
||||
|
||||
class Child extends Base
|
||||
def new()
|
||||
super.Method()
|
||||
enddef
|
||||
endclass
|
||||
|
||||
var obj = Child.new()
|
||||
assert_equal(true, obj.success)
|
||||
END
|
||||
v9.CheckScriptSuccess(lines)
|
||||
enddef
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user