@@ -68,6 +68,12 @@ locateModule
6868 -> m (Either [FileDiagnostic] Import)
6969locateModule dflags exts doesExist modName mbPkgName isSource = do
7070 case mbPkgName of
71+ -- "this" means that we should only look in the current package
72+ Just "this" -> do
73+ mbFile <- locateModuleFile dflags exts doesExist isSource $ unLoc modName
74+ case mbFile of
75+ Nothing -> return $ Left $ notFoundErr dflags modName $ LookupNotFound []
76+ Just file -> return $ Right $ FileImport file
7177 -- if a package name is given we only go look for a package
7278 Just _pkgName -> lookupInPackageDB dflags
7379 Nothing -> do