Talking errors in casting failures#903
Talking errors in casting failures#903davidepaolotua wants to merge 2 commits intoluckyframework:mainfrom
Conversation
Implements luckyframework#893. There is a breaking change, though. Previously, calling FailedCast#value would always return a nil value, without providing any clue on which value was actually breaking. Now, it raises a FailCastError with a talking error message, in the form of - for instance - "Value ->Invalid<- is not a valid constant for enum WhateverEnum".
|
Hmm... I'm not sure about this one 🤔 The I do see why you went this route though. I think I want to sit on this a little longer and see if there's an alternate way we can fix the issue without making some breaking changes here. Thanks for getting this started! |
Implements #893. There is a breaking change, though. Previously, calling FailedCast#value would always return a nil value, without providing any clue on which value was actually breaking.
Now, it raises a FailCastError with a talking error message, in the form of - for instance - "Value ->Invalid<- is not a valid constant for enum WhateverEnum".
Btw, is there an "easy" way to test avram modifications in a dummy lucky app?