simple integer refinement totality check
Open
@pnwamk is already working on this.
Since Apr 19, 2018.
- Dominant language
- Racket
- Stars
- 575
- Forks
- 106
- Avg merge
- 2h 1m
- Merged PRs (30d)
- 2
Description
It seems reasonable to expect Typed Racket to succeed in checking the following program:
#lang typed/racket #:with-refinements
(define-type SomeInts (Refine [n : Byte] (<= #x13 n #x15)))
(: foo (-> SomeInts Symbol))
(define (foo x)
(case x
[(#x13) 'RemoteUserTerminated]
[(#x14) 'RemoteDeviceTerminatedLowResources]
[(#x15) 'RemoteDeviceTerminatedPowerOff]))
i.e. although there's a nasty implicit else (void) that is inserted by the case macro, we should be able to prove that code is dead. Instead, we get this error message:
Type Checker: type mismatch
expected: Symbol
given: Void in: (case x ((19) (quote RemoteUserTerminated)) ((20) (quote RemoteDeviceTerminatedLowResources)) ((21) (quote RemoteDeviceTerminatedPowerOff)))
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.
Assessment
This issue has not been assessed yet.