std::ipv4_network validation error not correctly reported
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 6
- Avg merge
- 12h 25m
- Merged PRs (30d)
- 5
Description
I encountered an error while trying to set an ipv4 network on an entity:
Invalid value '172.25.103.22/24', does not match constraint `std::validate_type('ipaddress.IPv4Network',self)
But after some more investigation, it seems I forgot to use the network address. This was not correctly reported by the compiler. When I test the actual python type I get this:
>>> ipaddress.IPv4Network("172.25.103.22/24")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.12/ipaddress.py", line 1544, in __init__
raise ValueError('%s has host bits set' % self)
ValueError: 172.25.103.22/24 has host bits set
This would be good to report this in the compiler output error. Here is the minimal example I used to reproduce the error:
entity A:
std::ipv4_network net
end
implement A using std::none
A(net="172.25.103.22/24")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal entity A example in the issue and trace the std::validate_type('ipaddress.IPv4Network', self) validation path. Reproduce the host-bits error for 172.25.103.22/24 and identify how compiler validation errors are formatted; done means the compiler output reports that the IPv4 network has host bits set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100