sagax has quit [Read error: Connection reset by peer]
sagax has joined #crystal-lang
<FromGitter>
<naqvis> @Blacksmoke16 Generic modules are the problem. Believe its outstanding issue and they have proven to cause segfaults. Avoiding them makes program happy ⏎ ⏎ https://play.crystal-lang.org/#/r/9r2h
postmodern has quit [Quit: Leaving]
<FromGitter>
<asterite> Daily reminder to avoid generics inheritance until someone comes and fixes that
<FromGitter>
<Blacksmoke16> 😭 but whats interesting is there are other ways to not make it do that
<FromGitter>
<naqvis> i mean via such mechanism, one can just validate `address` in your above example, without having to annotate `Address`
<FromGitter>
<Blacksmoke16> ah i see what you mean, there are also callback validators, that like just invoke a method that you could use to do arbitrary logic that wouldnt be reusable
<FromGitter>
<naqvis> that's coool, but that's too complex for dumb person like me :P. Would it be possible to provide some-kind of call-back mechanism? or proc invocation?
<FromGitter>
<naqvis> just some random thoughts :P
<FromGitter>
<naqvis> > ah i see what you mean, there are also callback validators, that like just invoke a method that you could use to do arbitrary logic that wouldnt be reusable ⏎ ⏎ yeah, I believe i was talking this
<FromGitter>
<Blacksmoke16> i can get you an example in a sec, but it would basically just add an annotation to a method that takes the context and payload
<FromGitter>
<naqvis> no rush
<FromGitter>
<naqvis> annotating a custom validator is great design
<FromGitter>
<naqvis> 👍
<FromGitter>
<Blacksmoke16> one thing im not a super big fan of is needing to define the custom constraints within the `Athena::Validator::Constraints` namespace
<FromGitter>
<naqvis> yeah true
<FromGitter>
<naqvis> so giving users ability to define custom validators, would restrict their need for custom constraints
<FromGitter>
<naqvis> because constraints are usually generic, its just a validation mechanism which is unique for different cases
<FromGitter>
<naqvis> my views ofcourse :P
<FromGitter>
<Blacksmoke16> my biggest gripe is how the annotation and constraint are separate things
<FromGitter>
<Blacksmoke16> so i need ways to map an annotation to its constraint, and vice versa
<FromGitter>
<Blacksmoke16> is pointing to lib code, but message is prob clear enough :shrug:
<FromGitter>
<naqvis> yeah, will work as there isn't good IDE support available yet, but if there is some good support when double clicking on error take dev to specific location, then it will cause inconvenience :P
<FromGitter>
<Blacksmoke16> oh wait, `it` has `file`, `line`, and `end_line` arguments i could prob use
<FromGitter>
<naqvis> 👍
<FromGitter>
<Blacksmoke16> not sure how that work work exactly, but prob worth a shot
<FromGitter>
<naqvis> yeah, good to add that info to failure message
<FromGitter>
<Blacksmoke16> didnt fix the one in the detail view, wonder why that is
<FromGitter>
<Blacksmoke16> ohh, because thats where the assertion is actually failing
sorcus has quit [Quit: WeeChat 2.9]
<FromGitter>
<naqvis> I just skimmed through `validator` code and reason its showing the line number of your shard is because you are calling `fail` there
<FromGitter>
<naqvis> as you are generating code at compile time, wouldn't it be good that you raise in shard code base and capture inside the expanded code?
<FromGitter>
<Blacksmoke16> yea, i could define like `file_name` methods behind the scenes to at least give that right
<FromGitter>
<naqvis> and call fail there, it will show the line number of user spec instead of shard