diff options
5 files changed, 9 insertions, 10 deletions
diff --git a/examples/03-sum/output/typescript/src/shapes.ts b/examples/03-sum/output/typescript/src/shapes.ts index 9758cd6..144db10 100644 --- a/examples/03-sum/output/typescript/src/shapes.ts +++ b/examples/03-sum/output/typescript/src/shapes.ts @@ -8,7 +8,7 @@ type Shape = Rectangle | Triangle; export {type Shape}; class Rectangle { - public static readonly $tag = Symbol(); + public static readonly $tag = Symbol("Rectangle"); public readonly $tag: typeof Rectangle.$tag = Rectangle.$tag; @@ -28,7 +28,7 @@ class Rectangle { export {Rectangle}; class Triangle { - public static readonly $tag = Symbol(); + public static readonly $tag = Symbol("Triangle"); public readonly $tag: typeof Triangle.$tag = Triangle.$tag; diff --git a/examples/04-enum/output/typescript/src/numbers.ts b/examples/04-enum/output/typescript/src/numbers.ts index 14c8905..cbe9ed1 100644 --- a/examples/04-enum/output/typescript/src/numbers.ts +++ b/examples/04-enum/output/typescript/src/numbers.ts @@ -3,11 +3,11 @@ // Custom area start: imports // Custom area end: imports -const SmallNumber$Zero: unique symbol = Symbol(); +const SmallNumber$Zero: unique symbol = Symbol("Zero"); -const SmallNumber$One: unique symbol = Symbol(); +const SmallNumber$One: unique symbol = Symbol("One"); -const SmallNumber$Two: unique symbol = Symbol(); +const SmallNumber$Two: unique symbol = Symbol("Two"); const SmallNumber = { Zero: SmallNumber$Zero as typeof SmallNumber$Zero, diff --git a/examples/13-inductive-data-types/output/typescript/src/arithmetic.ts b/examples/13-inductive-data-types/output/typescript/src/arithmetic.ts index 486ac66..5f5926b 100644 --- a/examples/13-inductive-data-types/output/typescript/src/arithmetic.ts +++ b/examples/13-inductive-data-types/output/typescript/src/arithmetic.ts @@ -8,7 +8,7 @@ type Expression = Add | Const; export {type Expression}; class Add { - public static readonly $tag = Symbol(); + public static readonly $tag = Symbol("Add"); public readonly $tag: typeof Add.$tag = Add.$tag; @@ -28,7 +28,7 @@ class Add { export {Add}; class Const { - public static readonly $tag = Symbol(); + public static readonly $tag = Symbol("Const"); public readonly $tag: typeof Const.$tag = Const.$tag; diff --git a/examples/14-inductive-data-types-separate-namespaces/output/typescript/src/data/a.ts b/examples/14-inductive-data-types-separate-namespaces/output/typescript/src/data/a.ts index f8360f5..80f6ea9 100644 --- a/examples/14-inductive-data-types-separate-namespaces/output/typescript/src/data/a.ts +++ b/examples/14-inductive-data-types-separate-namespaces/output/typescript/src/data/a.ts @@ -10,7 +10,7 @@ type A = A1; export {type A}; class A1 { - public static readonly $tag = Symbol(); + public static readonly $tag = Symbol("A1"); public readonly $tag: typeof A1.$tag = A1.$tag; diff --git a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/typescripttypes/TypescriptTypesGenerator.java b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/typescripttypes/TypescriptTypesGenerator.java index 353f07b..508de55 100644 --- a/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/typescripttypes/TypescriptTypesGenerator.java +++ b/src/main/java/org/zwobble/hobgoblin/compiler/output/generators/typescripttypes/TypescriptTypesGenerator.java @@ -369,8 +369,7 @@ public class TypescriptTypesGenerator implements Generator { private TypescriptExpression generateSymbol(TypescriptIdentifier name) { return new TypescriptCall( TypescriptTypes.SYMBOL, - // TODO: add type name as string - List.of() + List.of(new TypescriptStringLiteral(name.value())) ); } } |
