Unclear error if a cycle dependency between namespaces #444
Open
opened 2022-12-16 17:01:29 +09:00 by davidyuk
·
2 comments
No Branch/Tag Specified
master
uw-aci
prh-docs-fix
uw-mldsa-crypto
uw-rename-fix-deps
bump_gmserialization
zomp
ceres
gh-pages
gh-485
dependabot/pip/dot-github/workflows/pygments-2.15.0
old_ceres
ghallak/split-typechecker
gh-400
new_ceres
loop-op
type-env
ghallak/229
option-force-msg
6.0.2
lima
call-fee
fix-ets
mergesort
lima-master-merge
optionally_generate_aci
changelog-update
make-return-reserved-word
radrow-patch-2
aens-subdomains
aens-at-full-node-ver
pt-166866806-claim-with-name-fee
extend-aci-interface
generalized_accounts_no_abi_move
roma
quickcheck-ci
v7.5.0
v7.4.0
v7.3.0
v7.2.1
v7.2.0
v7.1.0
v7.0.1
v7.0.0
v6.1.0
v6.0.2
v6.0.1
v6.0.0
v5.0.0
v4.3.0
v4.2.0
v4.1.0
v4.1.0-rc1
v4.0.0
v4.0.0-rc5
v4.0.0-rc4
v4.0.0-rc3
v4.0.0-rc1
v3.2.0
v3.1.0
v3.0.0
v2.1.0
v2.0.0
roma-v1
v2
Labels
Clear labels
WIP
bug
consensus-breaking
dependencies
documentation
duplicate
effort: high
effort: low
effort: medium
effort: trivial
enhancement
good first issue
help wanted
invalid
maintenance
question
task/feature
todo-in-rewrite
wontfix
bug
duplicate
enhancement
help wanted
invalid
pig lipstick
question
wontfix
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
Muggle-facing enhancements
More information is needed
This won't be fixed
No labels
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: QPQ-AG/sophia#444
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reproduction
Includes.aes
Library.aes
Sublibrary.aes
CLI prints an unclear error
it works if I include
numberfrom another namespace (without cycle deps). Sophia should disallow cycle dependencies explicitly or the above reproduction should work.First, this has nothing to do with includes. You can put the namespaces in the same file and it will still not work.
The error is produced because a namespace can only recognize what was written before it, so if you want to have a base namespace and a dependent namespace, you should have them in order.
Is there a specific situation where you need 2 namespaces to depend on each other, and you're not better off refactoring the code?
I would say that it's better to keep it this way in order to prevent messy designs, and the error messages are clear enough once you know that a namespace can only recognize what's written before it.
@radrow Do you have any opinion on this?
Created by: radrow
I think it would be much more user friendly if we explicitly point out that dependency cycles are not supported. For example functions within one namespace do support mutual recursion, so I can imagine this being confusing.