Comments (6)
A consider a bug to behave differently just for defining an intermediate variable
That's an incorrect expectation, at least in general. It can perhaps be defended in specific cases, but it has to specifically defended, you can't just point at the general principle and be done, since the general principle does not exist. Type inference in Scala 3 processes entire expressions. It's normal that the overall result might be different if you first give the type checker only part of the expression to work with, forcing it to decide on an answer based on partial information, and then only later give it the rest.
from dotty.
A workaorund is to define an intermediate variable:
val p2 = (p: Map[?, ?]).asScala
p2.map { case (k, v) => (k, v) }
I consider a bug to behave differently just for defining an intermediate variable.
from dotty.
Is the issue reproducible without involving an external dependency...?
from dotty.
Is the issue reproducible without involving an external dependency...?
I don't know, but the code I've shown it is quite simple and minimalistic.
from dotty.
A consider a bug to behave differently just for defining an intermediate variable
That's an incorrect expectation, at least in general. It can perhaps be defended in specific cases, but it has to specifically defended, you can't just point at the general principle and be done, since the general principle does not exist. Type inference in Scala 3 processes entire expressions. It's normal that the overall result might be different if you first give the type checker only part of the expression to work with, forcing it to decide on an answer based on partial information, and then only later give it the rest.
At least I don´t expect different results if I split an expression using an intermediate variable.
from dotty.
I don't know, but the code I've shown it is quite simple and minimalistic.
Regardless, reproducing a bug without an external dependency is considered the standard for bug reporting in this repository, for two main reasons:
- It's what we need in order to turn the report into a test case that can be added to our test suite
(but perhaps even more importantly:)
- it often gives considerable additional insight into the nature of the problem (including insight into whether the problem is in fact a bug in Scala itself, or somehow the external dependency's fault)
from dotty.
Related Issues (20)
- Match type with opaque type among cases does not resolve HOT 1
- 3.5.0 & 3.5.1-RC2 Release procedure HOT 2
- -Yexplicit-nulls fails to detect null pointer dereference HOT 3
- `-indent` `-rewrite` can produce inparsable code for curried methods taking triple-quote arguments HOT 3
- assertion failed: position not set for new com.augustnagro.magnum.SqlName # -1 of class dotty.tools.dotc.ast.Trees$Select HOT 1
- 3.4.3 Release procedure HOT 1
- Need a way to specify a method's charging a capture set parameter
- Match type fails to reduce when it doesn't look like it needs to reduce
- Nil and LinearSeq cannot be compared HOT 1
- Nightly Dotty workflow of 2024-08-16 failed HOT 2
- Automatic rewrite for `<function> _` can produce non-compiling code for curried functions
- Crash at inlining probably polutes the error reports when inlined value is `Nothing`
- Type mismatch after compiler rewrite for `A with B <:< C`
- Crash in match type with wildcards when using `-Xkind-projector:underscores` HOT 3
- Leaking scoped capabilities
- No workaround to dependent-type match types after SIP-56 HOT 6
- Import outside a package clause is not shadowed by an import inside the package clause
- Using full qualifier names for anonymous given naming to avoid double definition HOT 3
- Overloading resolution incorrectly drops alternative with match type result when a target type is provided
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotty.