hold a function type's parameters by value on the interface
A record a pub function type took or returned by value was declared only, so an importer could neither define a callback for it nor call one.
This commit is contained in:
@@ -527,6 +527,15 @@ ahead of its pub forms."
|
||||
"held by value"))
|
||||
(test-assert "returned"
|
||||
(interface-reports? "(record cell ((v int))) (pub fn f () cell)" "held by value"))
|
||||
(test-assert "or taken by a function a pub one takes"
|
||||
(interface-reports? "(record cell ((v int))) (pub fn take ((cb (fn ((c cell)) void))) void)"
|
||||
"held by value"))
|
||||
(test-assert "or returned by one"
|
||||
(interface-reports? "(record cell ((v int))) (pub fn take ((cb (fn () cell))) void)"
|
||||
"held by value"))
|
||||
(test "but a pointer there is still a pointer"
|
||||
'((record cell))
|
||||
(interface-of "(record cell ((v int))) (pub fn take ((cb (fn ((c (* cell))) void))) void)"))
|
||||
(test-assert "or taken by a pub method"
|
||||
(interface-reports? "(record cell ((v int))) (ops cell (pub fn get ((self cell)) int))"
|
||||
"held by value"))
|
||||
|
||||
Reference in New Issue
Block a user