Skip to content

Commit b3797d0

Browse files
authored
Refine String.slice/3 return type to t (#15553)
The spec declared `grapheme` instead, whose typedoc is "Multiple code points that may be perceived as a single character", but it may return multiple graphemes. `grapheme` is defined as `@type grapheme :: t`, so this is identical to analysis tools.
1 parent 065b853 commit b3797d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/elixir/lib/string.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2410,7 +2410,7 @@ defmodule String do
24102410
""
24112411
24122412
"""
2413-
@spec slice(t, integer, non_neg_integer) :: grapheme
2413+
@spec slice(t, integer, non_neg_integer) :: t
24142414

24152415
def slice(_, _, 0) do
24162416
""

0 commit comments

Comments
 (0)