You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope all is well. The documentation suggests that protocols are automatically generated for structs when using Vex.Struct but this appears to be broken since 1.14.
I copy-pasted the example presented in the In Structs section of the README to reproduce:
I created a vanilla mix project.
I created a new file called user.ex and copy-pasted the User module from the example into it.
I created a function called validate_user and added the usage example into it.
I ran the command both via the command line with mix run -c and interactively in iex.
Findings:
Version 1.12.3-otp-24 works as expected.
Version 1.13.4-otp-24 works as expected.
Version 1.14.1-otp-24 throws Protocol.UndefinedError.
The full error is:
(Protocol.UndefinedError)protocolVex.Extractnotimplementedfor%User{username: "actualuser",password: "abcdefghi",password_confirmation: "abcdefghi"} of type User (astruct).Thisprotocolisimplementedforthefollowingtype(s): Kernel,List,Map,Tuple(vex0.9.0) lib/vex/extract.ex:1: Vex.Extract.impl_for!/1(vex0.9.0) lib/vex/extract.ex:3: Vex.Extract.settings/1(vex0.9.0) lib/vex.ex:14: Vex.valid?/1
I had a look through the 1.14 changelog. Not much jumped out, the only thing I noticed was the following:
[Protocol] Expand :for in protocols with the appropriate env
I don't know if it's related. I'm still looking into that, and will update if I find out anything else.
The text was updated successfully, but these errors were encountered:
The changelog message above is a misnomer, that's from 1.14.2. The functionality is broken since 1.14.1.
I can confirm that the functionality does in fact also work in 1.14.0-rc.1 (installed 1.14.0-rc.1-otp-24 via asdf)
So clearly something changed after that release candidate.
darraghenright
changed the title
Automatic generation of Vex.Extract protocol when using Vex.Struct appears broken since 1.14
Automatic generation of Vex.Extract protocol when using Vex.Struct appears broken in 1.14.1
Dec 2, 2022
Hi folks 👋
I hope all is well. The documentation suggests that protocols are automatically generated for structs when using
Vex.Struct
but this appears to be broken since 1.14.I copy-pasted the example presented in the In Structs section of the README to reproduce:
mix
project.user.ex
and copy-pasted theUser
module from the example into it.validate_user
and added the usage example into it.mix run -c
and interactively iniex
.Findings:
1.12.3-otp-24
works as expected.1.13.4-otp-24
works as expected.1.14.1-otp-24
throwsProtocol.UndefinedError
.The full error is:
I had a look through the 1.14 changelog. Not much jumped out, the only thing I noticed was the following:
I don't know if it's related. I'm still looking into that, and will update if I find out anything else.
The text was updated successfully, but these errors were encountered: