Unexpected error when 2 provided args of same type are present
See original GitHub issueCode similar to this:
class MyClass @AssistedInject constructor(
foobar: Foobar,
@Assisted a: String,
@Assisted b: String
) {
@AssistedInject.Factory
interface Factory {
fun create(a: String, b: String): MyClass
}
}
Results in:
Duplicate @Assisted parameters declared. Forget a qualifier annotation?
Since @Assisted
args are supplied by the caller, it seems duplicates should be permitted. Am I missing something? Is this an annotation processing constraint?
I’ve solved the problem by adding qualifying annotations to both the MyClass
constructor declaration and the factory function.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
I'm getting a TypeError. How do I fix it? - Stack Overflow
It means exactly what it sounds like: there is an Error that is caused by the Type of one or more of the...
Read more >error=>#<ArgumentError: wrong number of arguments (given ...
An unexpected error occurred! {:error=>#<ArgumentError: wrong number of arguments (given 3, expected 1..2)> #13777.
Read more >How to Handle the Incompatible Types Error in Java - Rollbar
The Java incompatible types error happens when a value assigned to a variable or returned by a method is incompatible with the one...
Read more >Fixing common type problems - Dart
Fixing common type problems · Undefined member · Invalid method override · Missing type arguments · Unexpected collection element type · Constructor initialization ......
Read more >TypeError: More arguments needed - JavaScript | MDN
There is an error with how a function is called. More arguments need to be provided. Examples. Required arguments not provided. The Object....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think we gain anything. The intent was just to start with the semantics of a regular injector where order isn’t a thing.
For validation I’d be tempted to force the argument names to match only when you have more than one argument of the same type.
Sounds good to me. Thanks for the change.