Comments (4)
Hi @arjan, just to clarify, the change was a bug fix as it was impossible to distinguish a bodyless clause from a function that returned nil. This could even be the source of a bug in this lib. For example, if someone did:
@decorator Bla
def foo(bar, baz)
def foo(baz, baz) do
...
end
Note however that not only do/rescue is possible, but do
and any of rescue
/catch
/after
. So you probably want to check the Elixir version for v1.5+ and do nothing if the body is nil
and, if a keyword list, you traverse all pairs.
from decorator.
Thanks for the report. I never use rescue
on the function level. It seems it always worked magically, but in Elixir 1.5 they changed the AST for these constructs. I've updated the code.
from decorator.
Thanks I'll check that out and make sure it has coverage!
from decorator.
Thank you @josevalim and @arjan ! ❤️
from decorator.
Related Issues (20)
- OTP 20 / Elixir 1.5.0-rc.0 Rescue Emits Compiler Warning HOT 4
- Decorator is not compatible with `@impl` directive introduced in Elixir 1.5 HOT 4
- [Question] How to decorate all functions in a module? HOT 5
- Not working correctly when used with function head without body HOT 2
- Not working correctly when used for function with different arities HOT 2
- Default decoration for multiple function heads HOT 1
- Decorator used with Ecto HOT 3
- Release master HOT 4
- [Question] What to do about used/unused variable warnings? HOT 8
- [Question] is it possible to stack decorators? HOT 5
- Using two different decorator modules in the same file creates duplicate functions
- Can't Mock code used within the decorators HOT 1
- Can't use other modules macros while using decorator HOT 2
- Function result is `[]` when decorating a function head HOT 5
- Can't issue good compile-time errors re bad arguments
- Return other
- Unquoting default params results in elixir_locals.ensure_no_undefined_local/3 HOT 2
- Multiple decorators order
- separate tests and helper modules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decorator.