Following program defines 3 types and one function which tries to match the 3 types.
The error given is : "match syntax error in pattern in : (stc x)
Obvious question why ?
#lang typed/racket
(require racket/match )
(define-struct dsa ([ A : [U 'plus 'minus] ]))
(struct sb ([ B : Number]))
(define-type stc (U dsa sb))
(define f1
(lambda (x)
(match (x)
[(dsa A) 1]
[(sb B) 2]
[(stc x) 3]
)
)
)