I have created several custom classes:
- Category, containing a string with the category's name.
- SubCategory, extends Category.
- CategoryList, containing an array of Category instances and
a function getCategoryByName.
- SubCategoryTracer, with a function subTrace that traces the
name of a given SubCategory.
When I use subTrace, if the argument is a direct SubCategory,
it works fine, but if it's the result of getCategoryByName, even
when it does return a SubCategory object, I get the following
1118: Implicit coercion of a value with static type
tests:Category to a possibly unrelated type tests:SubCategory.