[tint][intrinsics] Add explicit template arguments

Re-introduce the <...> template syntax as a list of explicit template
arguments. These must be provided to match the overload.

Add the explicit-template overloads to the various intrinsic definition
files. The non-WGSL definition files probably don't need both implcit
and explicit overloads for many of these, but this keeps behaviour
consistent.

Change-Id: Ie8078db1ed578fa7c72890f9f47a9ebc8aee420e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/175244
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Ben Clayton <bclayton@google.com>
diff --git a/tools/src/tint/intrinsic/resolver/resolver_test.go b/tools/src/tint/intrinsic/resolver/resolver_test.go
index c73fd4b..b5d3cb8 100644
--- a/tools/src/tint/intrinsic/resolver/resolver_test.go
+++ b/tools/src/tint/intrinsic/resolver/resolver_test.go
@@ -78,6 +78,11 @@
 		}, {
 			`
 type f32
+fn f<T>(T) -> f32`,
+			success,
+		}, {
+			`
+type f32
 fn f[N: num]()`,
 			success,
 		}, {
@@ -93,6 +98,16 @@
 		}, {
 			`
 type f32
+fn f<T: f32>[N: num]()`,
+			success,
+		}, {
+			`
+type f32
+fn f[T: f32](T: f32) -> f32`,
+			success,
+		}, {
+			`
+type f32
 type P<T>
 match m: f32
 fn f[T: m](P<T>) -> T`,
@@ -108,13 +123,6 @@
 enum e { a b }
 type T<E: e>
 match m: e.a
-fn f[E: m](T<E>)`,
-			success,
-		}, {
-			`
-enum e { a b }
-type T<E: e>
-match m: e.a
 fn f(T<m>)`,
 			success,
 		}, {
@@ -158,6 +166,15 @@
 			success,
 		}, {
 			`
+type a
+type b
+type c
+match S: a | b | c
+type V<N: num, T>
+fn f<I: V<N, T> >[N: num, T: S, U: S](V<N, U>) -> I`,
+			success,
+		}, {
+			`
 type f32
 op -(f32)`,
 			success,
@@ -540,6 +557,28 @@
 			`
 @must_use fn f()`,
 			`file.txt:1:2 @must_use can only be used on a function with a return type`,
+		}, {
+			`
+type f32
+fn f<N: num>()`,
+			`file.txt:2:6 explicit number template parameters are not supported`,
+		}, {
+			`
+enum e { a b c }
+fn f<N: e>()`,
+			`file.txt:2:6 explicit number template parameters are not supported`,
+		}, {
+			`
+enum e { a b }
+type T<E: e>
+match m: e.a
+fn f<E: m>(T<E>)`,
+			`file.txt:4:6 explicit number template parameters are not supported`,
+		}, {
+			`
+fn f<T>[T]()`,
+			`file.txt:1:6 'T' already declared
+First declared here: file.txt:1:9`,
 		},
 	} {