Implement ForeachStatement for (static) Arrays

I am currently stuck at the semantic analysis.
because depending on the type of the expression that is itterated foreach does diffrent things
how I check If the itterated type has thoose methods ?
-  `popFront()`/`front()`
-  `opApply`

auto sr = SymbolResolver!delegate Field(var) { assert( cast(Field)var || cast(IntegerLiteral)var, "Not found"); return var };
auto size = sr.resolveInSymbol(expr, BuiltinName!"length");

Something like this, but cleaner?