Comments (4)
I confirmed what is happening with curry
. The automatically defined method has var-args *args
, which doesn't work with curry
without explicitly specifying rarity.
method(:on_object).curry(2)[1] # This works
The solution is to define arguments depending on the arity of the original method. Thinking of if it should be done now...
from rbs.
Just confirmed that it works. Honestly, your suggestion (passing arity to "curry" call) seems like a decent enough compromise, so I agree that it can be solved another time.
from rbs.
@soutaro can you reopen this? These changes seem to have caused syntax errors, at least when curry is used:
/usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/hook.rb:184:in `module_eval': /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/hook.rb:81: duplicated argument name (SyntaxError)
...ck, *rest_args_59607f4a, &block)
... ^~~~~
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/hook.rb:184:in `hook_instance_method'
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/tester.rb:64:in `block (2 levels) in install!'
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/tester.rb:53:in `each'
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/tester.rb:53:in `block in install!'
from <internal:kernel>:90:in `tap'
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/tester.rb:45:in `install!'
from /usr/local/bundle/ruby/3.0.0/bundler/gems/rbs-b07243f0f5ae/lib/rbs/test/setup.rb:69:in `block in <top (required)>'
from rbs.
@HoneyryderChuck Oh... 🙇♂️
from rbs.
Related Issues (20)
- `_Range[T]` shouldn't return `T?` for `begin` and `end`
- override a function with a block fails
- Singleton does not have method `instance` HOT 1
- add an `assert_const_type`
- Cannot specify type variables for `instance` HOT 6
- manifest.yaml does not allow gems as dependencies
- Proposal: making `Class` and `Module` classes generic -- `Class[I]` and `Module[I]` HOT 9
- Feature proposal: Multiple error on `rbs validate` HOT 1
- stringio should be a stdlib, but it's in `core/`
- Handling Classes created with Data#define HOT 1
- `RBS::Prototype::Runtime#block_from_ast_of` is dominant in terms of execution time.
- More improved support for `Struct` and `Data`.
- Migrate rbs prototype command information from soutaro/steep to ruby/rbs HOT 1
- Add in `&untyped` HOT 3
- Inconsistencies and Holes in with Grammar documentation HOT 4
- Support class redefinitions in runtime for rbs test mode HOT 7
- Somehow add metaprogramming to type parameters HOT 1
- Add Support for Non-Symbol Keyowrds
- Add support for `__END__` in rbs files HOT 1
- Add support for `alias $x $y` HOT 2
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 rbs.