We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.5.0-RC1-bin-SNAPSHOT (b10d64e)
import language.experimental.namedTuples import NamedTuple.{NamedTuple, AnyNamedTuple} // Repros for bugs or questions class ClassToMap[A]() abstract class ClassToFind[Rows <: AnyNamedTuple]: def mapped: NamedTuple.Map[Rows, ClassToMap] given TDB: ClassToFind[(t1: Int, t2: String)] with override def mapped = ( t1 = ClassToMap[Int](), t2 = ClassToMap[String]() ) type TypeAlias = (t1: Int, t2: String) class Repro1_Pass(using val testDB: ClassToFind[TypeAlias]) { def query() = testDB.mapped.t1 } class Repro1_Fail(using val testDB: ClassToFind[(t1: Int, t2: String)]) { def query() = testDB.mapped.t1 // fails to compile }
[error] 25 | testDB.mapped.t1 // fails to compile [error] | ^^^^^^^^^^^^^ [error] |Found: (x$proxy3 : [error] | (Repro1_Fail.this.testDB.mapped : [error] | => NamedTuple.Map[(t1 : Int, t2 : String), repro.ClassToMap]) [error] | & [error] | $proxy3.NamedTuple[ [error] | NamedTupleDecomposition.Names[ [error] | $proxy3.NamedTuple[(("t1" : String), ("t2" : String)), (Int, String)]], [error] | Tuple.Map²[ [error] | NamedTupleDecomposition.DropNames[ [error] | $proxy3.NamedTuple[(("t1" : String), ("t2" : String)), (Int, String)]], [error] | repro.ClassToMap] [error] | ] [error] |) [error] |Required: (repro.ClassToMap[Int], repro.ClassToMap[String])
It's unexpected that using a type alias enables the given instance to be found, but using the named tuple type directly does not.
The text was updated successfully, but these errors were encountered:
Add test for scala#20377 fixed in scala#20504
83cde98
Add test for #20377 fixed in #20504
fd7a463
Successfully merging a pull request may close this issue.
Compiler version
3.5.0-RC1-bin-SNAPSHOT (b10d64e)
Minimized code
Output
Expectation
It's unexpected that using a type alias enables the given instance to be found, but using the named tuple type directly does not.
The text was updated successfully, but these errors were encountered: