read a match scrutinee before a binder can shadow it
C has a declaration in scope from its own initializer, so in (match (* e) ((neg (e)) ...)) the binding read the new, uninitialized e. A binder named like a part of the scrutinee now has it held in a local.
This commit is contained in:
@@ -418,6 +418,9 @@ ahead of its pub forms."
|
||||
(test-assert "a path scrutinee is not copied"
|
||||
(not (emits? (sum-src "(match s ((circle (r)) (= out r)) (else (= out 0.0)))")
|
||||
"ƛm0")))
|
||||
(test-assert "unless a binder is named like a part of it"
|
||||
(emits? (sum-src "(match s ((circle (s)) (= out s)) (else (= out 0.0)))")
|
||||
"shape ƛm0 = s"))
|
||||
(test-assert "a macro scrutinee is typed by what it expands to"
|
||||
(emits? (string-append "(defmacro (the a) a)"
|
||||
(sum-src "(match (the s) ((circle (r)) (= out r))"
|
||||
|
||||
Reference in New Issue
Block a user