Open
Description
What version of Racket are you using?
Racket CS 7.9
What program did you run?
#lang typed/racket
(define foo%
(class object%
(init [unit : String])
(super-new)
(: _unit String)
(define _unit unit)
(: get-unit (-> String))
(define/public (get-unit) _unit)))
(new foo% [unit "kg"])
What should have happened?
The above should work the same as this:
#lang racket
(define foo%
(class object%
(init unit)
(super-new)
(define _unit unit)
(define/public (get-unit) _unit)))
(new foo% [unit "kg"])
If you got an error message, please include it here.
unit: bad syntax in: unit
More info:
Renaming unit to bar works in the typed/racket version.
Switching to typed/racket/base also works.