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
This requires an explicit downcast, since not every struct() is a valid t(). You know this particular one is, but the typechecker doesn't. That's where Gradient.TypeAnnotation comes in handy:
That way struct!/2 does the runtime check that params are valid for this particular struct, whereas assert_type(_, t()) let's the typechecker know that from now on it's not a general struct() type instance, but a proper t() instance.
Code:
Error
The text was updated successfully, but these errors were encountered: