Commit graph

165 commits

Author SHA1 Message Date
Leonardo de Moura
2ebcf29cde chore: use a[i]! for array accesses that may panic 2022-07-02 15:12:05 -07:00
Sebastian Ullrich
5e334b3e90 chore: postpone TSyntax adoption for some parts
The namespace `TSyntax.Compat` can be opened for a coercion
`Syntax -> TSyntax k` for any `k`, as otherwise this PR would never be done.
2022-06-27 22:37:02 +02:00
Leonardo de Moura
2a940dd4ae feat: add Expr.collectFVars, LocalDecl.collectFVars, Pattern.collectFVars, and AltLHS.collectFVars
They are all in `MetaM`.

These are helper functions for issue #1237. We need to "cleanup" the
local context before trying to compile the match-expression.

see issue #1237
2022-06-22 15:53:43 -07:00
Leonardo de Moura
22c8f10b12 chore: remove constant command 2022-06-14 17:14:28 -07:00
Leonardo de Moura
77ae79be46 chore: use let/if in do blocks 2022-06-13 17:10:14 -07:00
Leonardo de Moura
041827bed5 chore: unused variables 2022-06-07 17:54:10 -07:00
Sebastian Ullrich
ae7b895f7a refactor: unname some unused variables 2022-06-07 16:37:45 -07:00
Leonardo de Moura
d00d8a2104 fix: typo at copyDefaultValue?
see #1190
2022-06-06 07:57:23 -07:00
Leonardo de Moura
25126cd057 fix: autoParam is structure fields lost in multiple inheritance
closes #1158
2022-05-26 14:35:47 -07:00
Leonardo de Moura
dcb974a1cf chore: remove unused parameter 2022-05-26 14:20:51 -07:00
Jannis Limperg
6dc5ddac35 fix: apply after-compilation attributes to inductive/structure decls
Attributes with `AttributeApplicationTime.afterCompilation` were
silently not applied to `inductive` and `structure` declarations.
2022-05-25 11:32:08 -07:00
Leonardo de Moura
94d2a3ef86 feat: improve error message when failing to infer resulting universe level for inductive datatypes and structures 2022-05-10 18:30:53 -07:00
Leonardo de Moura
0b92195ec8 feat: refine auto bound implicit feature 2022-04-21 10:17:15 -07:00
Leonardo de Moura
8d2d0b3fbe chore: remove {} from structure command 2022-04-13 10:19:00 -07:00
Leonardo de Moura
efb859013e chore: ignore {} annotations at mk_projections 2022-04-13 10:16:41 -07:00
Leonardo de Moura
ea682830d1 refactor: change addTermInfo type 2022-04-08 15:01:57 -07:00
Leonardo de Moura
099fba43d3 chore: remove trace[Meta.debug] leftovers 2022-04-08 06:49:09 -07:00
Leonardo de Moura
de2e2447d2 chore: style 2022-04-07 17:35:05 -07:00
Leonardo de Moura
7c5575631a feat: remove _tmp_ind_univ_param elaboration hack
The new approach produces better type information in the "info view" when
hovering over inductive declarations.
2022-04-05 20:51:15 -07:00
Leonardo de Moura
743f6dd3a2 chore: cleanup 2022-04-03 06:56:27 -07:00
Leonardo de Moura
6631d92d7b fix: addAutoBoundImplicitsOld occurrences at MutualDef.lean and Structure.lean
This commit also fixes non-termination at `collectUnassignedMVars`
2022-03-25 09:07:59 -07:00
Leonardo de Moura
519b780164 doc: document InfoTree issue 2022-03-25 07:12:07 -07:00
Leonardo de Moura
0bd9de1cb9 perf: add InstantiateLevelCaches for types and values at CoreM 2022-03-15 17:42:38 -07:00
Leonardo de Moura
f7130d8e07 refactor: use CPS at addAutoBoundImplicits
We want to be able to declare new local variables there.
2022-03-05 16:24:33 -08:00
Gabriel Ebner
f8b43630a6 fix: refs to copied subobjects in diamond extension 2022-02-07 10:54:32 -08:00
Leonardo de Moura
12e2a79170 chore: fix codebase after removing auto pure 2022-02-03 18:08:14 -08:00
Gabriel Ebner
54cff10f3f fix: dependent fields in diamond extensions 2022-02-03 09:17:14 -08:00
Gabriel Ebner
7d4ae642fb fix: recursively copy subfields in diamond extends 2022-01-29 08:31:34 -08:00
Leonardo de Moura
68bd55af32 chore: fix codebase 2021-12-10 13:12:09 -08:00
Sebastian Ullrich
4f15805787 feat: annotate declarations with term infos 2021-11-27 07:25:15 -08:00
Leonardo de Moura
d9b057af03 fix: fixes #793 2021-11-22 13:28:08 -08:00
Gabriel Ebner
bfc74decde feat: add info field to Syntax.node 2021-10-26 20:19:27 +02:00
Leonardo de Moura
c02b4f2675 refactor: move to Meta namespace 2021-10-06 19:05:37 -07:00
Leonardo de Moura
7c9158a50e fix: structure command diamond support
Fixes issue described at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Structure.20diamond.20error
2021-08-19 07:45:21 -07:00
Leonardo de Moura
74bd537465 fix: generation of to* field names 2021-08-11 17:25:02 -07:00
Leonardo de Moura
39ce3044ec feat: emit warning message when failed to copy default value 2021-08-10 20:56:20 -07:00
Leonardo de Moura
61b3e6bcb8 fix: reduce projections of expanded structures at copyDefaultValue? 2021-08-10 20:50:59 -07:00
Leonardo de Moura
0623bb3860 feat: update fieldMap with composite field 2021-08-10 20:04:41 -07:00
Leonardo de Moura
ae03f15c92 test: default value set at copied structure 2021-08-10 19:00:34 -07:00
Leonardo de Moura
3b1285bee8 feat: process overriden default values in copied parents 2021-08-10 18:55:12 -07:00
Leonardo de Moura
295cae8afd feat: copy field default values
Only basic examples are working. We still have many TODOs
2021-08-10 16:53:10 -07:00
Leonardo de Moura
47b8fa15f1 fix: propagate visibility annotation 2021-08-10 15:34:07 -07:00
Leonardo de Moura
9cd729265e fix: missing instantiateMVars 2021-08-10 10:04:16 -07:00
Leonardo de Moura
9fe1cd1026 chore: modify default value for option structureDiamondWarning
We still have some TODO items, but structure diamond support is
already useful in practice.
2021-08-10 09:24:53 -07:00
Leonardo de Moura
50deae9b8b feat: copy binderInfo and inferMod from original field 2021-08-10 09:12:58 -07:00
Leonardo de Moura
bc26a9b527 feat: improve copyNewFieldsFrom 2021-08-10 09:08:35 -07:00
Leonardo de Moura
af1cecc641 feat: better error message 2021-08-10 07:46:15 -07:00
Leonardo de Moura
9e5998baf0 feat: register instance/reducible attribute for structuer diamond coercions 2021-08-10 07:16:59 -07:00
Leonardo de Moura
0f184a8c93 fix: binder annotation for class diamond coercions 2021-08-10 06:59:28 -07:00
Leonardo de Moura
bccad8edb1 feat: add coercion to parent structure whose fields having been copied 2021-08-09 19:01:08 -07:00