<FromGitter>
<franciscoadasme> hey, everyone, quick question. Is there a way to enforce that subclasses must have a method with the first argument of type `T`, but further arguments are allowed as well?, e.g., `A.foo(bar : Bar)` and `B.foo(bar: Bar, fuz = 1, ...)` are acceptable, but `C.foo(foo : Number)` isn't
<FromGitter>
<Blacksmoke16> do you want to allow *any* additional arguments, or a specific set?
<fullforce>
just pass on the self from the Test class to #puts_self
<FromGitter>
<Blacksmoke16> hmm
<FromGitter>
<Blacksmoke16> i dont have any good workarounds, but what is the use case for this?
<FromGitter>
<dscottboggs_gitlab> if you're talking about a superclass of type `T` then `abstract def`s don't pay attention to argument numbers or types, you're free to do as you please
<FromGitter>
<franciscoadasme> @Blacksmoke16 I also tried that, but I was wondering if the additional arguments in the subclass's method can be defined regularly, i.e., `A.foo(foo : Foo, arg1, arg2 = 2, ...)` instead of `A.foo(foo : Foo, **options)` and extract `arg1` and `arg2` (with default value) in the body
<FromGitter>
<Blacksmoke16> could maybe use a macro to do something similar
<FromGitter>
<Blacksmoke16> but using standard abstract defs i dont think you can since the signatures wouldnt match
<FromGitter>
<franciscoadasme> But first, how can I get the subclass' methods?, I tried `@type.methods` inside the `macro inherited` but it's empty
<FromGitter>
<franciscoadasme> and even if I get the subclass' methods somehow, how do I check the first argument's type?, this didn't work either: `B.methods[0].args[0].restriction == Int` (`restriction` is an `ASTNode`, where the documentation of `#==` states that it returns true if the node's textual representation is the same as the other node)
rohitpaulk has quit [Remote host closed the connection]
<FromGitter>
<j8r> I agree totally this shell script will better be removed
<FromGitter>
<j8r> It also complexify debugging
azuri5 has quit [Quit: azuri5]
wuehlmaus has quit [Read error: Connection reset by peer]
wuehlmaus has joined #crystal-lang
<wuehlmaus>
yesterday i deleted my crystal git because i thought that there were some files lying around so i wanted everything to be fresh. make takes so long and i am not even sure it will result in a crystal-git version now, even ``make docs'' takes so long ....
laaron- has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<franciscoadasme> @Blacksmoke16 hey, I just realized that changing the first argument's type to `String` doesn't work, it still raises the error
<FromGitter>
<franciscoadasme> ohhh, one needs to compare the `MacroId`s... but why the need to do that if the textual representations don't seem to change?
rohitpaulk has quit [Ping timeout: 250 seconds]
<FromGitter>
<bararchy> Is there a sure way to validate if a specific data is text (ASCII or UTF8) or binary data (random bytes, file, etc..)
<FromGitter>
<j8r> @bararchy you have a Slice of UInt8?
<FromGitter>
<Blacksmoke16> @franciscoadasme `==` also does type checking, so are prob of diff types thus not equal
livcd has joined #crystal-lang
<FromGitter>
<Blacksmoke16> i dont know types they are bug `.id` makes them both be `MacroId` so can compare the values
<FromGitter>
<jwoertink> Is there something special needed to add `@[Deprecated]` to an enum? Or is only methods supported on that?
<FromGitter>
<bararchy> Thanks @j8r
<FromGitter>
<jwoertink> also, what do you call this thing? `@[Whatever]`. Is that a "flag"?
<FromGitter>
<vladfaust> Annotation
<FromGitter>
<jwoertink> Ah, right. Thanks
<FromGitter>
<Blacksmoke16> :p
<FromGitter>
<Blacksmoke16> i remember reading it was only methods @jwoertink, however not sure if that changed at some point inbetween
<FromGitter>
<jwoertink> Yeah, I tried it on a few things and couldn't get it to show the warnings outside of methods
<FromGitter>
<jwoertink> so I guess that's the case for now
<FromGitter>
<Blacksmoke16> π
<FromGitter>
<j8r> wuehlmaus I'm opening a PR to remove the shell script :)
<mps>
j8r: please don't. it doesn't work in my case
<FromGitter>
<jwoertink> Is there a way with enums to have some sort of "constant_missing" type method? Like if I call an enum that doesn't exist, it calls a method similar to method_missing?
rohitpaulk has joined #crystal-lang
<FromGitter>
<Blacksmoke16> i dont think it would even compile?
<FromGitter>
<Blacksmoke16> if you reference an enum member that doesnt exist