Mono.CSharp.ImportedTypeDefinition.Error_MissingDependency C# (CSharp) Method

Error_MissingDependency() public static method

public static Error_MissingDependency ( IMemberContext ctx, List types, Mono.CSharp.Location loc ) : void
ctx IMemberContext
types List
loc Mono.CSharp.Location
return void
        public static void Error_MissingDependency(IMemberContext ctx, List<TypeSpec> types, Location loc)
        {
            //
            // Report details about missing type and most likely cause of the problem.
            // csc reports 1683, 1684 as warnings but we report them only when used
            // or referenced from the user core in which case compilation error has to
            // be reported because compiler cannot continue anyway
            //
            foreach (var t in types) {
                string name = t.GetSignatureForError ();

                if (t.MemberDefinition.DeclaringAssembly == ctx.Module.DeclaringAssembly) {
                    ctx.Module.Compiler.Report.Error (1683, loc,
                        "Reference to type `{0}' claims it is defined in this assembly, but it is not defined in source or any added modules",
                        name);
                } else if (t.MemberDefinition.DeclaringAssembly.IsMissing) {
                    ctx.Module.Compiler.Report.Error (12, loc,
                        "The type `{0}' is defined in an assembly that is not referenced. Consider adding a reference to assembly `{1}'",
                        name, t.MemberDefinition.DeclaringAssembly.FullName);
                } else {
                    ctx.Module.Compiler.Report.Error (1684, loc,
                        "Reference to type `{0}' claims it is defined assembly `{1}', but it could not be found",
                        name, t.MemberDefinition.DeclaringAssembly.FullName);
                }
            }
        }