Add a valid use of a private binding to private-binding test

This commit is contained in:
scottolsen 2020-06-19 15:01:27 -04:00
parent 915a539d2d
commit 0b34f9b31a
2 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,11 @@
(deftype Foo [bar Int])
(private Foo.bar)
(defmodule Foo
(defn get [foo]
(Foo.bar foo))
)
(defn boo [] @(Foo.bar &(Foo.init 1)))
(defn main [] (println* (Foo.bar &(Foo.init 1))))

View File

@ -1,2 +1,2 @@
private-bindings.carp:6:16 The binding: Foo.bar is private; it may only be used within the module that defines it.
private-bindings.carp:8:26 The binding: Foo.bar is private; it may only be used within the module that defines it.
private-bindings.carp:11:16 The binding: Foo.bar is private; it may only be used within the module that defines it.
private-bindings.carp:13:26 The binding: Foo.bar is private; it may only be used within the module that defines it.