1lab/mikan
13
52
Fork
You've already forked mikan
9

fix: only allow pragmas in the same file #111

Merged
amyliao merged 1 commit from pounce/mikan:pragma into main 2026年05月25日 13:50:30 +02:00
Contributor
Copy link

Resolves #90

Resolves #90
amyliao requested changes 2026年05月19日 17:51:40 +02:00
Dismissed
amyliao left a comment
Copy link

Let's also kill modifyGlobalDefinition and modifyGlobalSignature.

Let's also kill `modifyGlobalDefinition` and `modifyGlobalSignature`.
@ -757,2 +762,4 @@
{-else-} $ uselessPragma
"INLINE pragmas must appear in the same file as their corresponding definitions"
d@Constructor{ conSrcCon } | copatternMatchingAllowed conSrcCon
-> modifyGlobalDefinition x $ set lensTheDef d{ conInline = b }
Owner
Copy link

you missed constructors from imported modules

you missed constructors from imported modules
pounce marked this conversation as resolved
pounce force-pushed pragma from 4afd1c1987
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
to 2b70e6010e 2026年05月20日 14:49:02 +02:00
Compare
@ -1002,3 +1002,3 @@
setType (conName con) conType
-- Record telescope: Includes both parameters and fields.
modifyGlobalDefinition name $ set (lensTheDef . lensRecord . lensRecTel) fullTel
-- XXX(pounce): do we need to `modifyImportedSignature` here or above?
Author
Contributor
Copy link

i'd appreciate some insight here and then i can delete the comment

i'd appreciate some insight here and then i can delete the comment
Owner
Copy link

name is the name of the record type we just created, right? So it should be present in the stSignature, not stImports.

(You can also get rid of modifyImportedSignature now.)

`name` is the name of the record type we just created, right? So it should be present in the `stSignature`, not `stImports`. (You can also get rid of `modifyImportedSignature` now.)
pounce marked this conversation as resolved
pounce force-pushed pragma from 2b70e6010e to a3cba2ea32
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
2026年05月21日 12:50:35 +02:00
Compare
@ -184,3 +184,3 @@
setFunctionFlag :: FunctionFlag -> Bool -> QName -> TCM ()
setFunctionFlag flag val q = modifyGlobalDefinition q $ set (lensTheDef . funFlag flag) val
setFunctionFlag flag val q = setTCLens (stSignature . ix q . lensTheDef . funFlag flag) $ val
Owner
Copy link
setTCLens (stSignature . ix q . lensTheDef . funFlag flag) val
``` setTCLens (stSignature . ix q . lensTheDef . funFlag flag) val ```
pounce marked this conversation as resolved
pounce force-pushed pragma from a3cba2ea32
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
to 0286acb8f3
All checks were successful
ci/woodpecker/pr/test Pipeline was successful
2026年05月21日 16:25:02 +02:00
Compare
ncf approved these changes 2026年05月21日 17:15:28 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
1 - scope
language
Backwards-compatible changes to the surface language, such as adding new features.
1 - scope
language change
Breaking changes to a documented part of the surface language. These should be documented and specifically called out in the changelog.
1 - scope
performance
Semantics-preserving performance work.
1 - scope
task
Changes that are not apparent to the user, e.g. developer documentation and refactors, which do not need to be documented.
A: dead-code
Dead code elimination and --save-metas.
A: errors
Reporting of error and warning messages.
A: highlighting
Highlighting during interaction & literate compilation
A: imports
Handling of imports and interface file de/serialization.
A: infra
Iinfrastructure (e.g. CI, developer documentation, the build system, or the repository itself)
A: instance
Instance declarations, arguments, and resolution
A: lhs
LHS checking, coverage checking, and clause compilation
A: modules
Declaration and instantiation of parametrised modules.
A: parallel
Parallel typechecking.
A: positivity
Positivity checking
A: printing
Pretty-printing, display forms, and the wording of diagnostic messages
A: records
Record declarations, record expressions and copattern matching
A: scoping
Scope checking (ConcreteToAbstract)
A: termination
Termination checking
0 - type
bug
Issues describing an incorrect behaviour in the project, typos in the documentation, etc.
0 - type
discussion
An issue raised to gather opinions on a proposed change, or a suggested language change.
0 - type
question
An issue raised to ask a question.
9 - status
duplicate
This issue or pull request already exists.
9 - status
info needed
More information is needed from the submitter to decide how to proceed with the issue report.
9 - status
invalid
The issue report or pull request does not describe an actual bug, or does otherwise does not meet the contributing guidelines.
good first issue
Interested in contributing? Get started here.
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1lab/mikan!111
Reference in a new issue
1lab/mikan
No description provided.
Delete branch "pounce/mikan:pragma"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?