I'm trying to learn typed racket and I'm running into some type annotation issues.
#lang typed/racket
(require typed/racket/gui)
(define frame (new frame% [label "test frame"]))
(define tab-panel (new tab-panel% [parent frame] [choices '("One" "Two" "Three")]
[min-height 300] [min-width 300]
(callback
(lambda (tp e)
(case (send tp get-selection)
((0) (send tp change-children (lambda (children) (list a-panel))))
((1) (send tp change-children (lambda (children) (list b-panel))))
((2) (send tp change-children (lambda (children) (list c-panel)))))))))
(define a-panel (new panel% (parent tab-panel)))
(define a-text (new message% (parent a-panel) (label "A-panel")))
(define b-panel (new panel% (parent tab-panel)))
(define b-text (new message% (parent b-panel) (label "B-panel")))
(define c-panel (new panel% (parent tab-panel)))
(define c-text (new message% (parent c-panel) (label "C-panel")))
Generates the following errors on the lines in the case statement:
. Type Checker: missing type for identifier;
consider adding a type annotation with `:'
identifier: a-panel in: a-panel
. Type Checker: missing type for identifier;
consider adding a type annotation with `:'
identifier: b-panel in: b-panel
. Type Checker: missing type for identifier;
consider adding a type annotation with `:'
identifier: c-panel in: c-panel
. Type Checker: Summary: 3 errors encountered in:
a-panel
b-panel
c-panel
I've been digging through the documentation and I cannot seem to figure out the correct syntax for the type declaration to fix this issue.
This is not homework. I'm just trying to learn typed racket because I think strong typing is a good idea.