+ var candidate = search_module_in_paths(anode.hot_location, name, lookpaths)
+
+ if candidate == null then
+ if mmodule != null then
+ error(anode, "Error: cannot find module {name} from {mmodule}. tried {lookpaths.join(", ")}")
+ else
+ error(anode, "Error: cannot find module {name}. tried {lookpaths.join(", ")}")
+ end
+ return null
+ end
+ var res = self.load_module(candidate)
+ if res == null then return null # Forward error
+ return res.mmodule.as(not null)
+ end
+
+ # Search a module `name` from path `lookpaths`.
+ # If found, the path of the file is returned
+ private fun search_module_in_paths(location: nullable Location, name: String, lookpaths: Collection[String]): nullable String
+ do