/// <summary> /// Retrieves the <see cref="ILVariable"/> associated with this <see cref="ForeachStatement"/>, /// or <c>null</c> if no variable is associated with this foreach statement. /// </summary> public static ILVariable GetILVariable(this ForeachStatement loop) { if (loop.Annotation <ResolveResult>() is ILVariableResolveResult rr) { return(rr.Variable); } else { return(null); } }
/// <summary> /// Retrieves the <see cref="ILVariable"/> associated with this <see cref="ForeachStatement"/>, or <c>null</c> if no variable is associated with this foreach statement. /// </summary> public static ILVariable GetILVariable(this ForeachStatement loop) { var rr = loop.Annotation <ResolveResult>() as ILVariableResolveResult; if (rr != null) { return(rr.Variable); } else { return(null); } }
public static ILVariable GetILVariable(this ForeachStatement loop) { return(loop.Annotation <ILVariable>()); }