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:
William S Fulton 2021-03-23 23:57:49 +00:00
commit 90cdbee6a6
6 changed files with 64 additions and 10 deletions

View file

@ -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

View file

@ -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")