Adding strings should throw an error
See original GitHub issueIn CLI:
🦄 'a'+'b'
Expected: An error thrown.
Actual: Success
string ask(call(get('+'),'a','b'))
'0ab'
🦄
The task is to throw an error, which says “You cannot add strings with +, please use concat() instead”, if at least one of the operands is a string. If #260 is closed already, add also “or template literals” to the error message.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11
Top Results From Across the Web
javascript - Throwing strings instead of Errors
While it is okay possible to throw any value, it is generally considered poor form to throw anything other than an instance of...
Read more >TypeError: can only concatenate str (not "int") to str
This error occurs when you try adding (concatenating) an integer to a string. This error happens most commonly when trying to print an...
Read more >How to Throw Exceptions in Java
Throwing an exception is as simple as using the "throw" statement. You then specify the Exception object you wish to throw. Every Exception...
Read more >What to throw? Error or bare string dilemma
How throwing strings is better than throwing Errors. Statement throw can throw any type, not only Error s. Let's consider a sample code:...
Read more >Excel CONCAT function - string concatenation examples
You will learn how to concatenate strings with space, comma, ... represented by another function that throws an error), an error will occur....
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
@czerwinskilukasz1 yes, that’s also a type mismatch. Thanks!
Blocked on https://github.com/xFAANG/askql/issues/45