if (var.IsAssigned (parameters))
continue;
- Report.Error (177, loc, "The out parameter `" +
- var.Name + "' must be " +
- "assigned before control leaves the current method.");
+ Report.Error (177, loc, "The out parameter `{0}' must be assigned to before control leaves the current method",
+ var.Name);
}
}
return s;
if (finally_vector != null) {
- Report.Error (
- 157, loc, "Control can not leave the body " +
- "of the finally block");
+ Report.Error (157, loc,
+ "Control cannot leave the body of a finally clause");
return null;
}
if (!branching.IsFieldAssigned (vi, field.Name)) {
Report.Error (171, loc,
- "Field `" + TypeManager.CSharpName (Type) +
- "." + field.Name + "' must be fully initialized " +
- "before control leaves the constructor");
+ "Field `{0}' must be fully assigned before control leaves the constructor",
+ TypeManager.GetFullNameSignature (field));
ok = false;
}
}
field_hash.Add (field.Name, ++Length);
else if (sinfo [i].InTransit) {
Report.Error (523, String.Format (
- "Struct member '{0}.{1}' of type '{2}' causes " +
+ "Struct member `{0}.{1}' of type `{2}' causes " +
"a cycle in the structure layout",
type, field.Name, sinfo [i].Type));
sinfo [i] = null;
public bool IsAssigned (EmitContext ec)
{
- return !ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (this);
+ return !ec.DoFlowAnalysis ||
+ ec.OmitStructFlowAnalysis && TypeInfo.IsStruct ||
+ ec.CurrentBranching.IsAssigned (this);
}
public bool IsAssigned (EmitContext ec, Location loc)
public bool IsFieldAssigned (EmitContext ec, string name, Location loc)
{
- if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsFieldAssigned (this, name))
+ if (!ec.DoFlowAnalysis ||
+ ec.OmitStructFlowAnalysis && TypeInfo.IsStruct ||
+ ec.CurrentBranching.IsFieldAssigned (this, name))
return true;
Report.Error (170, loc,