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.

Union of Function0 creates an intersection of return type (regression from 3.1.1?)

See original GitHub issue

Compiler version

3.1.3

Minimized code

object EB:
  type Outcome = Command | SideEffect | CmdEffect
  type OutcomeSpec =  Command | (() => Unit) | (() => Seq[Command])

  inline def asOutcome(o: OutcomeSpec): Outcome =
    inline o match
      case c: Command         => c
      case f: (() => Seq[Command]) => CmdEffect(_ => f())
      case f: (() => Unit)    => SideEffect(_ => f())

  inline def apply[S](ev: WithSource[Event, S], ctx: String, f: OutcomeSpec): EB[S] = 
...

EB(b.st.release, "", () => Seq.empty[Command])

Output

Found:    Seq[Command]
Required: Unit & Seq[Command]

Expectation

In 3.1.1 this compiled fine, not sure if this is a regression or the rules changed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SethTisuecommented, Sep 6, 2022

Will wait till 3.2.1 I guess

try 3.2.1-RC1, which is now out

0reactions
unthingablecommented, Sep 6, 2022

I have just upgraded to 3.2.0 and the bug is still present. Will wait till 3.2.1 I guess.

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.1.3.2.3 - Unions | STAT 200
A union is communicated using the symbol ∪. P ( A ∪ B ) is read as "the probability of A or B."...
Read more >
Index (Spark 3.1.1 JavaDoc)
Returns an array of the elements in the intersection of the given two arrays, without duplicates. array_join(Column, String, String) - Static method in ......
Read more >
Union of Intersections (UoI) for Interpretable Data Driven ...
In UoI, feature compression via intersections and feature expansion via unions are balanced to maximize prediction accuracy of the sparsely estimated model ...
Read more >
Chapter 7: Correlation and Simple Linear Regression
Correlation is defined as the statistical association between two variables. ... Scatterplot with regression model illustrating a residual value.
Read more >
Regression
To predict a score: ✓ Multiply the explanatory variable by the slope. ✓ Add the result to the value of the intercept. Page...
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