From 6107e05e8cdeefc598d49ec10f21c61dc325a0e2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sun, 15 Apr 2018 15:56:59 -0700 Subject: [PATCH] Added test for tagged templates in new expressions. --- .../taggedTemplatesWithTypeArguments2.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts diff --git a/tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts b/tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts new file mode 100644 index 00000000000..9c9bb8ee938 --- /dev/null +++ b/tests/cases/conformance/es6/templates/taggedTemplatesWithTypeArguments2.ts @@ -0,0 +1,20 @@ +// @target: esnext +// @strict: true + +export interface SomethingTaggable { + (t: TemplateStringsArray, ...args: T[]): SomethingNewable; +} + +export interface SomethingNewable { + new (...args: T[]): any; +} + +declare const tag: SomethingTaggable; + +const a = new tag `${100} ${200}`("hello", "world"); + +const b = new tag `${"hello"} ${"world"}`(100, 200); + +const c = new tag `${100} ${200}`("hello", "world"); + +const d = new tag `${"hello"} ${"world"}`(100, 200);