+ resolved = true;
+
+ if (rc.HasSet (ResolveContext.Options.ExpressionTreeConversion))
+ flags |= Flags.IsExpressionTree;
+
+ try {
+ if (!ResolveMeta (rc, ip))
+ return false;
+
+ using (rc.With (ResolveContext.Options.DoFlowAnalysis, true)) {
+ FlowBranchingToplevel top_level = rc.StartFlowBranching (this, parent);
+
+ if (!Resolve (rc))
+ return false;
+
+ unreachable = top_level.End ();
+ }
+ } catch (Exception e) {
+ if (rc.CurrentBlock != null) {
+ rc.Report.Error (584, rc.CurrentBlock.StartLocation, "Internal compiler error: {0}", e.Message);
+ } else {
+ rc.Report.Error (587, "Internal compiler error: {0}", e.Message);
+ }
+
+ if (Report.DebugFlags > 0)
+ throw;
+ }
+
+ if (rc.ReturnType != TypeManager.void_type && !unreachable) {
+ if (rc.CurrentAnonymousMethod == null) {
+ rc.Report.Error (161, md.Location, "`{0}': not all code paths return a value", md.GetSignatureForError ());
+ return false;
+ } else if (!rc.CurrentAnonymousMethod.IsIterator) {
+ rc.Report.Error (1643, rc.CurrentAnonymousMethod.Location, "Not all code paths return a value in anonymous method of type `{0}'",
+ rc.CurrentAnonymousMethod.GetSignatureForError ());
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ bool ResolveMeta (BlockContext ec, ParametersCompiled ip)
+ {
+ int errors = ec.Report.Errors;
+ int orig_count = parameters.Count;
+