Question regarding NIntegrate using the Arg function

I am having some trouble when trying to evaluate this simple integral using NIntegrate:

NIntegrate[Cos[t + Arg[ (-I + 4 t)]], {t, 0., 1.}]


The error message is

NIntegrate::nlim: t = Arg[-I+4 t] is not a valid limit of integration.

There are ways of avoiding this problem, such as choosing the integration method (Method -> "Trapezoidal".) What is not clear to me is where this error is coming from. If I plot the function being integrated, there is no issue.

Thank you.

NIntegrate attempts a bit of symbolic analysis of the integrand before integrating. That seems to be messing something up. Hide your function from symbolic analysis:
f[x_?NumericQ] := Cos[t + Arg[(-I + 4 t)]]

• also NIntegrate[Cos[t + Arg[(-I + 4 t)]], {t, 0., 1.}, Method -> {Automatic, "SymbolicProcessing" -> False}]. – AccidentalFourierTransform Aug 3 '18 at 18:19