diff --git a/src/components/gradient_waveforms/no_gradient_blocks.jl b/src/components/gradient_waveforms/no_gradient_blocks.jl
index d11996b2934f031035168cd0deaab638422762a2..7226db13a36605bb6a52675055f88c60d9a3b2eb 100644
--- a/src/components/gradient_waveforms/no_gradient_blocks.jl
+++ b/src/components/gradient_waveforms/no_gradient_blocks.jl
@@ -15,7 +15,7 @@ Usually, you do not want to create this object directly, use a `BuildingBlock` i
 """
 struct NoGradient{N} <: GradientWaveform{N}
     duration :: VariableType
-    function NoGradient{N}(duration)
+    function NoGradient{N}(duration) where {N}
         if !(N in (1, 3))
             error("Dimensionality of the gradient should be 1 or 3, not $N")
         end