Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Flags
safe-html, strict-same
Loading…
|
Translation uploaded |
|
|
String added in the repository |
|
Consider this example. As was discussed in a previous section, <<ref_is_map_like>> requires that your key type satisfies <<ref_is_string_like>>. Now, let's say your keys are not string-like, but they do convert to <<ref_string>>. You can make such maps to also convert to objects using a context. But if you want to also use another context for values, you need a way to pass the full combined context to map elements. So, you want the following test to succeed.考虑以下示例。如前一节所述,<<ref_is_map_like>>要求键类型满足<<ref_is_string_like>>。现在,假设您的键不是类字符串类型,但它们确实可以转换为<<ref_string>>。您可以通过上下文使此类映射也转换为对象。但如果您想同时为值使用另一个上下文,则需要一种方式将完整的组合上下文传递给映射元素。因此,您希望以下测试能够成功。</ref_string></ref_is_string_like></ref_is_map_like>