infer a type for fields sans declared type
This commit is contained in:
parent
4cd90a6295
commit
e75af5ae1c
|
@ -156,7 +156,9 @@
|
||||||
(⇒ : ★/t)
|
(⇒ : ★/t)
|
||||||
(⇒ ν-f (τ))])
|
(⇒ ν-f (τ))])
|
||||||
|
|
||||||
(define-typed-syntax (field [x:id τ-f:type e:expr] ...) ≫
|
(define-typed-syntax field
|
||||||
|
[(_ [x:id τ-f:type e:expr] ...) ≫
|
||||||
|
#:cut
|
||||||
#:fail-unless (stx-andmap flat-type? #'(τ-f ...)) "keep your uppity data outta my fields"
|
#:fail-unless (stx-andmap flat-type? #'(τ-f ...)) "keep your uppity data outta my fields"
|
||||||
[⊢ e ≫ e- (⇐ : τ-f)] ...
|
[⊢ e ≫ e- (⇐ : τ-f)] ...
|
||||||
#:fail-unless (stx-andmap pure? #'(e- ...)) "field initializers not allowed to have effects"
|
#:fail-unless (stx-andmap pure? #'(e- ...)) "field initializers not allowed to have effects"
|
||||||
|
@ -166,7 +168,12 @@
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
[⊢ (erased (field/intermediate [x x- τ e-] ...))
|
[⊢ (erased (field/intermediate [x x- τ e-] ...))
|
||||||
(⇒ : ★/t)
|
(⇒ : ★/t)
|
||||||
(⇒ ν-ep (MF))])
|
(⇒ ν-ep (MF))]]
|
||||||
|
[(_ flds ... [x:id e:expr] more-flds ...) ≫
|
||||||
|
#:cut
|
||||||
|
[⊢ e ≫ e- (⇒ : τ)]
|
||||||
|
--------------------
|
||||||
|
[≻ (field flds ... [x τ e-] more-flds ...)]])
|
||||||
|
|
||||||
(define-typed-syntax (assert e:expr) ≫
|
(define-typed-syntax (assert e:expr) ≫
|
||||||
[⊢ e ≫ e- (⇒ : τ)]
|
[⊢ e ≫ e- (⇒ : τ)]
|
||||||
|
|
Loading…
Reference in New Issue