diff --git a/examples/rune/index.ts b/examples/rune/index.ts new file mode 100644 index 0000000..ad2336d --- /dev/null +++ b/examples/rune/index.ts @@ -0,0 +1,9 @@ +// Code generated by tygo. DO NOT EDIT. + +////////// +// source: rune.go + +/** + * Should be a number in TypeScript. + */ +export type MyRune = number /* rune */; diff --git a/examples/rune/rune.go b/examples/rune/rune.go new file mode 100644 index 0000000..a04f6a4 --- /dev/null +++ b/examples/rune/rune.go @@ -0,0 +1,4 @@ +package rune + +// Should be a number in TypeScript. +type MyRune rune diff --git a/tygo.yaml b/tygo.yaml index b14c1d5..4f5455d 100644 --- a/tygo.yaml +++ b/tygo.yaml @@ -53,5 +53,6 @@ packages: - path: "github.com/gzuidhof/tygo/examples/emit" exclude_files: - "excluded.go" + - path: "github.com/gzuidhof/tygo/examples/rune" diff --git a/tygo/write.go b/tygo/write.go index 6dc6a42..3caf4f2 100644 --- a/tygo/write.go +++ b/tygo/write.go @@ -43,7 +43,8 @@ func getIdent(s string) string { case "int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "float32", "float64", - "complex64", "complex128": + "complex64", "complex128", + "rune": return "number /* " + s + " */" } return s