File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ builtin_initialize identifierSuggestionForAttr : PersistentEnvExtension
4747 | -- Attributes parsed _before the suggest_for notation is added
4848 .node _ ``Parser .Attr.simple #[.ident _ _ `suggest_for [], .node _ `null #[id]] => pure #[id]
4949 | _ => throwError " Invalid `[suggest_for]` attribute syntax {repr stx}"
50+ if isPrivateName decl then
51+ throwError " Cannot make suggestions for private names"
5052 modifyEnv (ext.addEntry · (decl, altSyntaxIds.map (·.getId)))
5153 }
5254
Original file line number Diff line number Diff line change @@ -510,3 +510,17 @@ public meta def delab : Lean.PrettyPrinter.Delaborator.Delab :=
510510
511511public def noMetaDelab : Lean.PrettyPrinter.Delaborator.Delab :=
512512 default
513+
514+ /-- error: Cannot make suggestions for private names -/
515+ #guard_msgs in
516+ @[suggest_for Bar1]
517+ def FooBar1 := 4
518+
519+ /-- error: Cannot make suggestions for private names -/
520+ #guard_msgs in
521+ @[suggest_for Bar2]
522+ meta def FooBar2 := 4
523+
524+ #guard_msgs in
525+ @[suggest_for Bar3 FooBar1 FooBar2]
526+ public def FooBar3 := 4
You can’t perform that action at this time.
0 commit comments