You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Unfortunately it's possible for a nested splat on scalar values to
1942
+
// generate non-homogenously-typed vals, and we discovered this bad
1943
+
// interaction after the two conflicting behaviors were both
1944
+
// well-established so it isn't clear how to change them without
1945
+
// breaking existing code. Therefore we just make that an error for
1946
+
// now, to avoid crashing trying to constuct an impossible list.
1947
+
if!cty.CanListVal(vals) {
1948
+
diags=append(diags, &hcl.Diagnostic{
1949
+
Severity: hcl.DiagError,
1950
+
Summary: "Invalid nested splat expressions",
1951
+
Detail: "The second level of splat expression produced elements of different types, so it isn't possible to construct a valid list to represent the top-level result.\n\nConsider using a for expression instead, to produce a tuple-typed result which can therefore have non-homogenous element types.",
1952
+
Subject: e.Each.Range().Ptr(),
1953
+
Context: e.Range().Ptr(), // encourage a diagnostic renderer to also include the "source" part of the expression in its code snippet
0 commit comments