aboutsummaryrefslogtreecommitdiff
path: root/doc/langref.html.in
diff options
context:
space:
mode:
authorDaniele Cocca <daniele.cocca@gmail.com>2021-04-28 01:13:47 +0100
committerDaniele Cocca <dcocca@google.com>2021-06-16 22:03:02 +0100
commit9be2f767417ef4eb69f35b67348bb3e2ec752d4a (patch)
treeec3eb55e45146939458cf801ea07b78080ef81a6 /doc/langref.html.in
parent171102ea7ca3a11113d2ccfb7206b0eaddab19ac (diff)
downloadzig-9be2f767417ef4eb69f35b67348bb3e2ec752d4a.tar.gz
zig-9be2f767417ef4eb69f35b67348bb3e2ec752d4a.zip
typeName: amend return type to string literal
This was already the case, but the documentation failed to point out that the returned value is of type `*const [N:0]u8`, i.e. that of a string literal. Also adds a behavioral test to assert that this is the case.
Diffstat (limited to 'doc/langref.html.in')
-rw-r--r--doc/langref.html.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index c7a677bb8e..4da857bbc2 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -8623,7 +8623,7 @@ test "integer truncation" {
{#header_close#}
{#header_open|@typeName#}
- <pre>{#syntax#}@typeName(T: type) [N]u8{#endsyntax#}</pre>
+ <pre>{#syntax#}@typeName(T: type) *const [N:0]u8{#endsyntax#}</pre>
<p>
This function returns the string representation of a type, as
an array. It is equivalent to a string literal of the type name.