@@ -1767,19 +1767,19 @@ let rec ResolveLongIndentAsModuleOrNamespace atMostOne amap m fullyQualified (ne
17671767
17681768 UndefinedName( 0 , FSComp.SR.undefinedNameNamespaceOrModule, id, suggestModulesAndNamespaces))
17691769
1770- let moduleNotFoundErrorCache = ref None
1771- let moduleNotFound ( modref : ModuleOrNamespaceRef ) ( mty : ModuleOrNamespaceType ) id depth=
1772- match ! moduleNotFoundErrorCachewith
1773- | Some error-> error
1774- | None ->
1770+ letmutable moduleNotFoundErrorCache = None
1771+ let moduleNotFound ( modref : ModuleOrNamespaceRef ) ( mty : ModuleOrNamespaceType ) ( id : Ident ) depth =
1772+ match moduleNotFoundErrorCachewith
1773+ | Some( oldId , error) when oldId = id.idRange -> error
1774+ | _ ->
17751775let suggestNames () =
17761776 mty.ModulesAndNamespacesByDemangledName
17771777|> Seq.filter( fun kv -> IsEntityAccessible amap m ad( modref.NestedTyconRef kv.Value))
17781778|> Seq.collect( fun e -> [ e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName])
17791779|> HashSet
17801780
17811781let error = raze( UndefinedName( depth, FSComp.SR.undefinedNameNamespace, id, suggestNames))
1782- moduleNotFoundErrorCache:= Some error
1782+ moduleNotFoundErrorCache<- Some( id.idRange , error)
17831783 error
17841784
17851785match moduleOrNamespaces.TryFind id.idTextwith