question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support key projection as a second parameter of div operation

See original GitHub issue

Is it possible to use multiple key projections with div operator? The div operation requires <T0, T1> -> <T1, T2> relation, but keyProjection returns KProperty1<out Any, T> and it is not acceptable as an argument due to the incompatibility of T1 != out Any. It means that only standard KProperty1 can be provided as an argument to KProperty1.div function.

Package::dailyStats.keyProjection(dateId) / DailyStats::requests.keyProjection(version) / [...]
                                                                 ^--- illegal because it's KProperty<out Any, Version>
Package::dailyStats.keyProjection(dateId) / DailyStats::something / [...]
                                                                 ^--- valid because it's KProperty<DailyStats, Version>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zigzagocommented, Apr 11, 2021

I reproduce the bug. I’m going to fix it.

1reaction
zigzagocommented, Apr 11, 2021

Hello,

You can workaround the issue like this:

data class Map1(val p1: Map<String, Map2>)
data class Map2(val p2: Map<String, String>)

    @Test
    fun `multiple key projection`() {
        (Map1::p1.keyProjection("a") /
                (Map2::p2.keyProjection("b")  as  KProperty1<Map2, Map<String, String>>)
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Projection expressions - Amazon DynamoDB
A projection expression is a string that identifies the attributes that you want. To retrieve a single attribute, specify its name. For multiple...
Read more >
Projection operations (C#) - Microsoft Learn
Projection refers to the operation of transforming an object into a new form that often consists only of those properties that will be ......
Read more >
Setting multiple attributes for an element at once with JavaScript
If I need to call a function that depends on two attributes, usually attributeChangedCallback is called twice, one for each attribute change. Accessing...
Read more >
MongoDB Projection & Projection Operators Explained
The first value is the element to be ignored, while the second value is how many remaining elements to be returned. If the...
Read more >
Content projection - Angular
Content projection is a pattern in which you insert, or project, the content you want to use inside another component. For example, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found