- /// <remarks>
- /// The types have to be initialized after the initial
- /// population of the type has happened (for example, to
- /// bootstrap the corlib.dll
- /// </remarks>
- public static bool InitCoreTypes (ModuleContainer module, BuildinTypes buildin)
- {
- var ctx = module.Compiler;
- foreach (var p in buildin.Types) {
- var found = PredefinedType.Resolve (module, p.Kind, p.Namespace, p.Name, p.Arity, Location.Null);
- if (found == null || found == p)
- continue;
-
- if (!RootContext.StdLib) {
- var ns = module.GlobalRootNamespace.GetNamespace (p.Namespace, false);
- ns.ReplaceTypeWithPredefined (found, p);
-
- var tc = found.MemberDefinition as TypeContainer;
- tc.SetPredefinedSpec (p);
- p.SetDefinition (found);
- }
- }
-
- if (InternalType.Dynamic.GetMetaInfo () == null) {
- InternalType.Dynamic.SetMetaInfo (object_type.GetMetaInfo ());
-
- if (object_type.MemberDefinition.IsImported)
- InternalType.Dynamic.MemberCache = object_type.MemberCache;
-
- InternalType.Null.SetMetaInfo (object_type.GetMetaInfo ());
- }
-
- return ctx.Report.Errors == 0;
- }
-