From 0ff4365945540b6654901f9e727918531b184340 Mon Sep 17 00:00:00 2001 From: Markus Hauru Date: Wed, 22 Jan 2020 14:22:03 +0100 Subject: [PATCH] A more helpful error message when splatting into @ncon. --- src/indexnotation/tensormacros.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/indexnotation/tensormacros.jl b/src/indexnotation/tensormacros.jl index fc3602aa..4595eeb0 100644 --- a/src/indexnotation/tensormacros.jl +++ b/src/indexnotation/tensormacros.jl @@ -184,6 +184,9 @@ function _nconmacro(tensors, indices, kwargs = nothing) else throw(ArgumentError("invalid @ncon syntax")) end + if any(isa(ta, Expr) && ta.head === :... for ta in tensorargs) + throw(ArgumentError("@ncon does not support splats (...) in tensor lists.")) + end conjlist = fill(false, length(tensorargs)) for i = 1:length(tensorargs) if tensorargs[i] isa Expr