typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

Refinement type editor/repl inconsistency

Open iamevn opened this issue 3 years ago • 1 comments

Racket version 8.0 [cs]

I forgot to specify a return type on a function and was having issues with type checking in the repl.

#lang typed/racket #:with-refinements

(define-type Two (Refine [n : Integer] (= n 2)))

(define (f [n : Two]) : Void
  (void))

(define (g [n : Two])
  (void))

(f 1) ;; Type Checker: type mismatch expected: Two given: (Refine (x₀ : One) (= 1 x₀)) in: 1
(f 2) ;; works

(g 1) ;; Type Checker: type mismatch expected: Two given: (Refine (x₀ : One) (= 1 x₀)) in: 1
(g 2) ;; works in definitions window, fails in interactions window

Type checking works as expected in the definitions window but when I try to run (g 2) in the interactions window I get a type error:

 Type Checker: type mismatch
  expected: Two
  given: Positive-Byte in: 2

iamevn avatar May 24 '21 22:05 iamevn

Probably related to #671

capfredf avatar Jun 03 '21 20:06 capfredf