File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -735,9 +735,15 @@ defmodule IEx.Introspection do
735735 ## Helpers
736736
737737 defp format_typespec ( definition , kind , nesting ) do
738- "@#{ kind } #{ Macro . to_string ( definition ) } "
739- |> Code . format_string! ( line_length: IEx . width ( ) - 2 * nesting )
740- |> IO . iodata_to_binary ( )
738+ string = "@#{ kind } #{ Macro . to_string ( definition ) } "
739+
740+ try do
741+ string
742+ |> Code . format_string! ( line_length: IEx . width ( ) - 2 * nesting )
743+ |> IO . iodata_to_binary ( )
744+ rescue
745+ _ -> string
746+ end
741747 |> color_prefix_with_line ( )
742748 |> indent ( nesting )
743749 end
Original file line number Diff line number Diff line change @@ -853,6 +853,7 @@ defmodule IEx.HelpersTest do
853853 defmodule TypeSample do
854854 @typedoc "An ID with description."
855855 @type id_with_desc :: {number, String.t}
856+ @type unquote(:"?")() :: :question_mark
856857 end
857858 """
858859
@@ -872,6 +873,11 @@ defmodule IEx.HelpersTest do
872873
873874 An ID with description.
874875 """
876+
877+ assert capture_io ( fn -> t ( TypeSample . "?" ( ) ) end ) == """
878+ @type ?() :: :question_mark
879+
880+ """
875881 end )
876882 after
877883 cleanup_modules ( [ TypeSample ] )
You can’t perform that action at this time.
0 commit comments