Skip to content

Fixed Elixir 1.20 compilation warnings#10

Merged
reisub merged 1 commit intoreisub:mainfrom
GRoguelon:elixir-1.20.0-rc.1
Jan 28, 2026
Merged

Fixed Elixir 1.20 compilation warnings#10
reisub merged 1 commit intoreisub:mainfrom
GRoguelon:elixir-1.20.0-rc.1

Conversation

@GRoguelon
Copy link
Contributor

Hi,

This PR fixes the compilation warnings raised by Elixir 1.20.0-rc.1.

Warnings

mix compile --force
Compiling 9 files (.ex)
    warning: unused require Logger
    │
  7 │   require Logger
    │   ~
    │
    └─ lib/http_cookie/date_parser.ex:7:3

     warning: a struct for HttpCookie is expected on struct update:

         %HttpCookie{cookie | last_access_time: now}

     but got type:

         dynamic()

     where "cookie" was given the type:

         # type: dynamic()
         # from: lib/http_cookie.ex:150:31
         cookie

     when defining the variable "cookie", you must also pattern match on "%HttpCookie{}".

     hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

         user = some_function()
         %User{user | name: "John Doe"}

     it is enough to write:

         %User{} = user = some_function()
         %{user | name: "John Doe"}

     typing violation found at:
     │
 151 │     %__MODULE__{cookie | last_access_time: now}
     │     ~
     │
     └─ lib/http_cookie.ex:151:5: HttpCookie.update_last_access_time/2

Generated http_cookie app

Setup

mise use erlang@28.3.1 elixir@1.20.0-rc.1-otp-28

@reisub reisub merged commit ae593de into reisub:main Jan 28, 2026
2 checks passed
@reisub
Copy link
Owner

reisub commented Jan 28, 2026

Thanks @GRoguelon!

@reisub
Copy link
Owner

reisub commented Jan 28, 2026

Released with v0.9.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants