Python -builtin fix wrapping constructors with varargs
Fix compilation error when using -builtin and wrapping varargs in constructors Closes #1942
This commit is contained in:
parent
71709af99a
commit
90cdbee6a6
6 changed files with 64 additions and 10 deletions
|
|
@ -122,3 +122,18 @@ try:
|
|||
raise RuntimeError("missed exception")
|
||||
except TypeError as e:
|
||||
pass
|
||||
|
||||
# Varargs
|
||||
f = VarargConstructor(fmt="Ciao")
|
||||
f.vararg_method(fmt="Bonjour")
|
||||
try:
|
||||
f = VarargConstructor(nonexistent="Ciao")
|
||||
raise RuntimeError("missed exception")
|
||||
except TypeError as e:
|
||||
pass
|
||||
|
||||
try:
|
||||
f.vararg_method(nonexistent="Bonjour")
|
||||
raise RuntimeError("missed exception")
|
||||
except TypeError as e:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import varargs
|
|||
if varargs.test("Hello") != "Hello":
|
||||
raise RuntimeError("Failed")
|
||||
|
||||
vc = varargs.VarargConstructor("Hey there")
|
||||
if vc.str != "Hey there":
|
||||
raise RuntimeError("Failed")
|
||||
|
||||
f = varargs.Foo("Greetings")
|
||||
if f.str != "Greetings":
|
||||
raise RuntimeError("Failed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue