Mono.CSharp.Statement.ResolveUnreachable C# (CSharp) Method

ResolveUnreachable() public method

We already know that the statement is unreachable, but we still need to resolve it to catch errors.
public ResolveUnreachable ( BlockContext ec, bool warn ) : bool
ec BlockContext
warn bool
return bool
		public virtual bool ResolveUnreachable (BlockContext ec, bool warn)
		{
			//
			// This conflicts with csc's way of doing this, but IMHO it's
			// the right thing to do.
			//
			// If something is unreachable, we still check whether it's
			// correct.  This means that you cannot use unassigned variables
			// in unreachable code, for instance.
			//

			if (warn)
				ec.Report.Warning (162, 2, loc, "Unreachable code detected");

			ec.StartFlowBranching (FlowBranching.BranchingType.Block, loc);
			bool ok = Resolve (ec);
			ec.KillFlowBranching ();

			return ok;
		}