Skip to content

function arity of type-annotation not checked against definition #998

Open
@bdeket

Description

@bdeket

What version of Racket are you using?

Welcome to DrRacket, version 7.9.0.5 [3m].

What program did you run?

#lang typed/racket/base

(: test1 (->* [Integer]
              [Integer
               Integer]
              Integer))
(define (test1 a [b 0])
  (cond
    [(and a b) 1]
    [else      2]))

(define (run1)
  (test1 0 1 2))

What should have happened?

this program type-checks, where I would expect a failure to type-check.

on calling (run1) you get:

test1: arity mismatch;
 the expected number of arguments does not match the given number
  given: 3
  arguments...:
   0
   1
   2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions