# HG changeset patch # User Westerbly Snaydley # Date 1685771762 10800 # Sat Jun 03 02:56:02 2023 -0300 # Node ID 2de3b02906dd78b695a3976075a9cdb7fdfdec48 # Parent b0976439a0de5a5d86e76a3d60e9d9076e719b9e * property: forward repr and tostring to value-type diff --git a/lib/scopes/property.sc b/lib/scopes/property.sc --- a/lib/scopes/property.sc +++ b/lib/scopes/property.sc @@ -53,6 +53,12 @@ inline (self value) setter (bitcast (view self) T) value + inline __repr (self) + repr (get self) + + inline __tostring (self) + tostring (get self) + Accessor inline "generate-property" (value key) (property-type (typeof value) key) value diff --git a/testing/test_property.sc b/testing/test_property.sc --- a/testing/test_property.sc +++ b/testing/test_property.sc @@ -26,6 +26,6 @@ test (iof.int == 11) iof.int += 1 test (iof.int == 12) - + test + (repr iof.int) == (repr 12) ; -