We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2044cb7 + fb651bd commit 37f3ddaCopy full SHA for 37f3dda
test/Parse/type_parameter_packs_executable.swift
@@ -0,0 +1,19 @@
1
+// REQUIRES: executable_test
2
+// RUN: %target-run-simple-swift
3
+
4
+import StdlibUnittest
5
6
+var suite = TestSuite("ParameterPackTestSuite")
7
8
+suite.test("operator precedence") {
9
+ // Test 'a * each b + c' is parsed and operator-folded as '(a * (each b)) + c'
10
+ func _test<each T: Numeric>(args arg: repeat each T) -> (repeat each T) {
11
+ (repeat 2 * each arg + 3)
12
+ }
13
14
+ let result = _test(args: 12, 12.3)
15
+ expectEqual(result.0, 2 * 12 + 3)
16
+ expectEqual(result.1, 2 * 12.3 + 3)
17
+}
18
19
+runAllTests()
0 commit comments