File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed
Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,11 @@ def liftMacroM [Monad m] [MonadMacroAdapter m] [MonadEnv m] [MonadRecDepth m] [M
186186 match (← expandMacroImpl? env stx) with
187187 | some (_, stx?) => liftExcept stx?
188188 | none => return none
189- hasDecl := fun declName => return env.contains declName
189+ hasDecl := fun declName => do
190+ -- this is used (by mkUnusedBaseName) to find available names, so check
191+ -- for both private and public names
192+ let env := env.setExporting false
193+ return env.contains (mkPrivateName env declName) || env.contains (privateToUserName declName)
190194 getCurrNamespace := return currNamespace
191195 resolveNamespace := fun n => return ResolveName.resolveNamespace env currNamespace openDecls n
192196 resolveGlobalName := fun n => return ResolveName.resolveGlobalName env opts currNamespace openDecls n
Original file line number Diff line number Diff line change 1+ module
2+
3+ set_option warn.sorry false
4+
5+ public class X
6+ instance : X := sorry
7+ public instance : X := sorry
8+ instance : X := sorry
9+
10+ namespace InNamespace
11+ public class Y
12+ instance : Y := sorry
13+ public instance : Y := sorry
14+ instance : Y := sorry
15+ end InNamespace
16+
17+
18+ inductive Day where
19+ | mo | tu | we
20+ deriving Repr
21+
22+ def Day.succ? : Day → Option Day
23+ | mo => some tu
24+ | tu => some we
25+ | we => none
26+
27+ instance : Std.PRange.UpwardEnumerable Day where
28+ succ? := Day.succ?
29+
30+ def Day.toNat : Day → Nat
31+ | mo => 0
32+ | tu => 1
33+ | we => 2
34+
35+ instance : LT Day where
36+ lt _ _ := True
37+
38+ instance : LE Day where
39+ le _ _ := True
40+
41+ instance : Std.Rxo.IsAlwaysFinite Day where
42+ finite init hi := ⟨3 , by sorry ⟩
43+
44+ instance : Std.Rxi.IsAlwaysFinite Day where
45+ finite init := ⟨3 , by sorry ⟩
46+
47+ instance : Std.Rxc.IsAlwaysFinite Day where
48+ finite init hi := ⟨3 , by sorry ⟩
You can’t perform that action at this time.
0 commit comments