[plt-scheme] Typed Scheme and substructures

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Sun Apr 5 18:17:38 EDT 2009

Shouldn't this be OK?

#lang typed-scheme
(define-struct: (A) s ([x : A]))
(define-struct: (A) (t s) ())

(: f (All (A) ((t A) -> A)))
(define (f z)
   (s-x z))

Welcome to DrScheme, version 4.1.5.3-svn2apr2009 [3m].
Language: Module custom; memory limit: 512 megabytes.
typecheck: Polymorphic function s-x could not be applied to arguments:
Domain: (s A)
Arguments: (t A)
Result type: A
Expected result: A
  in: (s-x z)

David


Posted on the users mailing list.