Skip to content

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

@bdeket

Description

@bdeket
Contributor

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

Activity

capfredf

capfredf commented on Nov 17, 2020

@capfredf
SponsorMember

Seems like test1 should not type check in the first place.

self-assigned this
on Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @capfredf@bdeket@jackfirth

      Issue actions

        function arity of type-annotation not checked against definition · Issue #998 · racket/typed-racket