feat(frontends/lean/structure_cmd): mark structure as 'class' when [class] modifier is used

This commit is contained in:
Leonardo de Moura 2014-11-03 17:46:03 -08:00
parent b112f3c582
commit 9531203d9d
3 changed files with 14 additions and 0 deletions

View file

@ -35,6 +35,7 @@ Author: Leonardo de Moura
#include "frontends/lean/tokens.h"
#include "frontends/lean/elaborator_exception.h"
#include "frontends/lean/type_util.h"
#include "frontends/lean/class.h"
namespace lean {
static name * g_tmp_prefix = nullptr;
@ -558,6 +559,8 @@ struct structure_cmd_fn {
add_alias(m_name, false);
add_alias(m_mk);
add_rec_alias(rec_name);
if (m_modifiers.is_class())
m_env = add_class(m_env, m_name);
}
void save_def_info(name const & n) {

View file

@ -0,0 +1,9 @@
structure point [class] (A : Type) (B : Type) :=
mk :: (x : A) (y : B)
print classes
structure point2 (A : Type) (B : Type) :=
mk :: (x : A) (y : B)
print classes

View file

@ -0,0 +1,2 @@
point : Type → Type → Type
point : Type → Type → Type