Comments (2)
This issue involves checkNumericConstraintGuardsOK
. This function makes the assumption that by the time it is invoked, all numeric constraint guard expressions have been checked to have a type signature. (See the comment here.) This isn't actually true, however. The code in Cryptol.Parser.ExpandPropGuards
does check that top-level numeric constraint guards have type signatures, but it does not check any constraint guards in where
expressions.
Two ways we could fix this:
- Make
Cryptol.Parser.ExpandPropGuards
recurse intowhere
expressions and reject any nested constraint guards it encounters. (This would make this error message later in the typechecker unreachable, so we could remove it.) - Do not assume that by the time
checkNumericConstraintGuardsOK
is invoked, we have checked all constraint guards to have a type signature.
I am leaning more towards option (1), since this is the sort of thing that we could easily detect (and reject) in the parser, well before we get to the typechecker.
from cryptol.
Yeah, I also think (1) is the way to go.
from cryptol.
Related Issues (20)
- `:eval` crashes when evaluating `roundAway`
- Some docstring comments are lost
- CI: Downloading GHC on test jobs is wasteful
- Export `push` and `pop` from `Cryptol.TypeCheck.Solver.SMT`
- Fix the `PP` instance for `PrimIdent`
- Make a dev_setup script HOT 2
- PrimeEC::ec_mult can produce incorrect results HOT 4
- Avoid showing unique numbers HOT 1
- Define `head`, `tail`, `last` with patterns, or expose the list selector with type index?
- Unwrap HOT 5
- Incorrect checking of polymorphic `case` HOT 1
- `update` and `updates` type variable swap
- Generalize instantiations with `interface`
- Interface constraint scoping HOT 1
- Add implcit imports for modules defined by instantiation
- Panic: Unexpeceted numeric constraint HOT 5
- Test suite: normalize path separators across different operating systems
- Panic: type cannot be demoted inf - inf HOT 3
- Rexporting functor parameters in an instantiation HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryptol.