lean4-htt/tests/pkg/module/Module/MetaImported.lean
Sebastian Ullrich c4747752fe
fix: detect private references in inferred type of public def (#10762)
This PR fixes an inconsistency in the module system around defs with
elided types.
2025-10-15 12:51:54 +00:00

20 lines
556 B
Text

module
meta import Module.Basic
/-! Basic phase restriction tests. -/
/--
error: Invalid definition `nonMeta`, may not access declaration `f` imported as `meta`; consider adding `import Module.Basic`
-/
#guard_msgs in
def nonMeta := f
/-- error: Invalid `meta` definition `veryMeta`, `nonMeta` not marked `meta` -/
#guard_msgs in
meta def veryMeta := nonMeta
/--
error: Invalid public `meta` definition `pubMetaImp`, `pubMeta` is not accessible here; consider adding `public import Module.Basic`
-/
#guard_msgs in
public meta def pubMetaImp := pubMeta