Skip to content

Commit 60a28f8

Browse files
committed
Do not use opaque type for URI authority
1 parent 3bb5f92 commit 60a28f8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lib/elixir/lib/uri.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ defmodule URI do
3232
@derive {Inspect, optional: [:authority]}
3333
defstruct [:scheme, :authority, :userinfo, :host, :port, :path, :query, :fragment]
3434

35+
# We don't use opaque because URIs can be inlined,
36+
# either via module attributes or by the compiler.
37+
@typep opaque_authority :: nil | binary
38+
39+
@typedoc deprecated: "The authority field is deprecated"
40+
@type authority :: opaque_authority()
41+
3542
@type t :: %__MODULE__{
3643
scheme: nil | binary,
3744
authority: authority,
@@ -43,9 +50,6 @@ defmodule URI do
4350
fragment: nil | binary
4451
}
4552

46-
@typedoc deprecated: "The authority field is deprecated"
47-
@opaque authority :: nil | binary
48-
4953
defmodule Error do
5054
@moduledoc """
5155
An exception raised when an error occurs when a `URI` is invalid.

0 commit comments

Comments
 (0)