24 lines
557 B
Text
24 lines
557 B
Text
structure A : Type := mk
|
|
structure B : Type := mk
|
|
constant f : A → B
|
|
constant g : B → B
|
|
constant a : A
|
|
|
|
namespace foo
|
|
coercion f
|
|
print coercions
|
|
check g a
|
|
end foo
|
|
|
|
check g a -- Error
|
|
|
|
section boo
|
|
coercion f
|
|
print coercions
|
|
check g a
|
|
end boo
|
|
-- The metaobjects defined in the section persist to the outer level.
|
|
-- This is not a bug. The idea is: we can use the scope to define
|
|
-- auxiliary variables that are then used to define classes/instances/etc.
|
|
-- That is, the whole point of the scope is to define these metaobjects.
|
|
check g a -- Ok
|