loader: `MModule::load` cause build_module_importation
[nit.git] / src / frontend / check_annotation.nit
index 9408e95..d640ac2 100644 (file)
@@ -40,7 +40,7 @@ private class CheckAnnotationPhase
        do
                # Get the mmodule
                var mmodule = nmodule.mmodule
-               assert mmodule != null
+               if mmodule == null then return
                self.mmodule = mmodule
 
                # If no decl block then quit
@@ -61,7 +61,7 @@ private class CheckAnnotationPhase
 
                        for m in super_mmodules do
                                if declared_annotations[m].has(name) then
-                                       modelbuilder.warning(annot, "multiple-annotation-declarations", "Warning: an annotation `{name}` is already declared in module `{m}`")
+                                       modelbuilder.warning(annot, "multiple-annotation-declarations", "Warning: an annotation `{name}` is already declared in module `{m}`.")
                                        break label
                                end
                        end
@@ -76,6 +76,8 @@ private class CheckAnnotationPhase
        var primtives_annotations_list = """
 new_annotation
 
+conditional
+
 deprecated
 fixed
 lazy
@@ -84,7 +86,7 @@ readonly
 writable
 autoinit
 noautoinit
-cached
+lateinit
 nosuper
 old_style_init
 abstract
@@ -92,6 +94,8 @@ intern
 extern
 no_warning
 
+auto_inspect
+
 pkgconfig
 cflags
 ldflags
@@ -111,7 +115,7 @@ platform
                if primtives_annotations.has(name) then return
 
                var mmodule = self.mmodule
-               assert mmodule != null
+               if mmodule == null then return
 
                # Lazily build the full user-list
                var annots = user_annotations.get_or_null(mmodule)
@@ -124,7 +128,7 @@ platform
 
                if annots.has(name) then return
 
-               toolcontext.modelbuilder.warning(nat, "unknown-annotation", "Warning: unknown annotation `{name}`")
+               toolcontext.modelbuilder.warning(nat, "unknown-annotation", "Warning: unknown annotation `{name}`.")
 
                annots.add(name) # to avoid multiple errors on the same name
        end