-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Regression Aug 15th-17th in community build compiling Squants #2994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My guess would be #2962 |
Minimized: object Test {
object Energy {
private def parse(value: Any) = ???
def apply = parse _
}
// Energy.apply("") // works!
Energy("") // crashy-boom-boom
} |
Felix's reduction is incorrect because it doesn't compile with scalac either. |
Here's the corrected version, I'm hoping github mail works - because we object Test {
object Energy {
def apply(load: Int): Int = load
private def parse(value: Any) = ???
def apply = parse _
}
Energy("")
} |
Any update on this? The community build is still red for Squants. https://travis-ci.org/lampepfl/dotty-community-build/jobs/270746972#L588 |
We concluded that the code is bad and that it should be changed. What happens is that the call So it tries:
The code should be changed to: Sorry for the delayed response, |
Fair enough, I agree with the conclusion 👍 |
We should put this in the spec, though :) |
I am reopening this issue. The following code snippet is rejected by Dotty but with an unrelated error message: object Test {
object Energy {
private def parse(value: Any) = ???
def apply = parse _
}
Energy("")
} -- [E043] Syntax Error: tests/allan/Test.scala:23:2 ----------------------------
23 | Energy("")
| ^^^^^^
| overloaded or recursive method Energy needs return type
|
I think the culprit is 30ac9e2#diff-7c63b7bfffa9340fb48ac9b61fa56beeR1931, some conditions were added to check if we're in an overloaded or recursive method call but I don't understand what they're based on. We could revert to the previous logic here. |
- Rewrite `apply = parse _` to `apply(x: Any) = parse(x)`: scala/scala3#2994 - Remove self type: scala/scala3#2214
- Rewrite `apply = parse _` to `apply(x: Any) = parse(x)`: scala/scala3#2994 - Remove self type: scala/scala3#2214
I would guess the same. Allan can you revert that commit and see whether it passes? |
Fix #1905: Detect case where bridge would clash with the member
- Rewrite `apply = parse _` to `apply(x: Any) = parse(x)`: scala/scala3#2994 - Remove self type: scala/scala3#2214
- Rewrite `apply = parse _` to `apply(x: Any) = parse(x)`: scala/scala3#2994 - Remove self type: scala/scala3#2214
- Rewrite `apply = parse _` to `apply(x: Any) = parse(x)`: scala/scala3#2994 - Remove self type: scala/scala3#2214
Compilation errors
Definition of
Energy
https://github.com/dotty-staging/squants/blob/616fe0d74bedea35a5b2f0e79dc3c42cbaa5b0ce/shared/src/main/scala/squants/energy/Energy.scala#L27The text was updated successfully, but these errors were encountered: