Make the arb.choice function take derived classes
See original GitHub issueI am using the new Arb.choice function (Kotest version 4.0.5) and when I use derived classes I need to cast them. For example
Arb.choice(
Arb.constant(RuntimeException(message)) as Arb<Exception>,
Arb.constant(Exception(message)),
Arb.constant(IllegalArgumentException(message)) as Arb<Exception>,
Arb.constant(IllegalStateException(message)) as Arb<Exception>
)
I would like to know if it is possible to declare their types internally as anything that derive from T so I won’t need to cast them. Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (11 by maintainers)
Top Results From Across the Web
The Different Therapeutic Choices with ARBs. Which One to ...
For hypertensive patients at a higher risk of stroke, losartan should be the first therapeutic option; telmisartan, eprosartan and candesartan ...
Read more >1. Inheritance hierarchies 2. Implementing derived classes 3 ...
Implementing derived classes. 3. Overriding member functions. 4. Virtual functions and polymorphism. Big C++ by Cay Horstmann.
Read more >Choice of drug therapy in primary (essential) hypertension
In most patients, the drugs should be selected from among the three preferred classes (ie, ACE inhibitors [or ARBs], calcium channel blockers, ...
Read more >Angiotensin receptor blockers (ARBs) - Heart Matters magazine
ARBs treat heart failure and high blood pressure and may be prescribed following a heart attack. We explain how they work, what they're...
Read more >Derived classes - cppreference.com
Any class type (whether declared with class-key class or struct ) may be declared as derived from one or more base classes which,...
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 Free
Top 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
👍 Thank you, it works!!
If you’re ready with it james make sense to take yours.
On Thu, 30 Apr 2020, 11:18 James Pittendreigh, notifications@github.com wrote: