diff --git a/transpile_python/service.go b/transpile_python/service.go index 301f941..a2a6c49 100644 --- a/transpile_python/service.go +++ b/transpile_python/service.go @@ -703,6 +703,8 @@ func handleValueSpecValues(values []ast.Expr) string { switch v := value.(type) { case *ast.BasicLit: code += handleBasicLit(v) + case *ast.CompositeLit: + code += handleCompositeLit(v) case *ast.BinaryExpr: code += handleBinaryExpr(v) case *ast.SelectorExpr: diff --git a/transpile_python/service_test.go b/transpile_python/service_test.go index b0d6192..4af55bb 100644 --- a/transpile_python/service_test.go +++ b/transpile_python/service_test.go @@ -117,6 +117,20 @@ def main(): t = True o = True main() +` + Compare(source, expected) + }) + + It("Array declaration", func() { + source := `package test + import . "skidl" + + var a = []any{} + ` + expected := `from skidl import * + +a = [] + ` Compare(source, expected) })