refuse _ in a pub var's type
Importers declare a pub var from its type alone, with nothing to solve a wildcard against, so (pub var n _ 42) reached them as extern _ n.
This commit is contained in:
@@ -531,6 +531,15 @@ ahead of its pub forms."
|
||||
(test "nor a private fn's"
|
||||
'()
|
||||
(interface-of "(record cell ((v int))) (fn f ((c cell)) void)"))
|
||||
;; importers are given the declaration, not the initializer, so `_'
|
||||
;; reached them unsolved: `extern _ n'
|
||||
(test-assert "a pub var's type is written out"
|
||||
(interface-reports? "(pub var n _ 42)" "write it out"))
|
||||
(test-assert "all of it"
|
||||
(interface-reports? "(pub var p (* _) 0)" "write it out"))
|
||||
(test "a private one is solved where it is"
|
||||
'()
|
||||
(interface-of "(var n _ 42)"))
|
||||
(test-assert "held by value it is an error"
|
||||
(interface-reports? "(record cell ((v int))) (pub record shape ((c cell)))"
|
||||
"held by value"))
|
||||
|
||||
Reference in New Issue
Block a user