|
61 | 61 | 28 | case (name = n, age = a) => () // error // error
|
62 | 62 | | ^^^^^^^
|
63 | 63 | | No element named `age` is defined in selector type (String, Int)
|
64 |
| --- [E172] Type Error: tests/neg/named-tuples.scala:30:27 --------------------------------------------------------------- |
| 64 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:30:21 ------------------------------------------------------ |
65 | 65 | 30 | val pp = person ++ (1, 2) // error
|
66 |
| - | ^ |
67 |
| - | Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), Tuple] =:= (true : Boolean). |
68 |
| --- [E172] Type Error: tests/neg/named-tuples.scala:33:18 --------------------------------------------------------------- |
| 66 | + | ^^^^^^ |
| 67 | + | Found: (Int, Int) |
| 68 | + | Required: NamedTuple.NamedTuple[N2, Tuple] |
| 69 | + | |
| 70 | + | where: N2 is a type variable with constraint <: Tuple |
| 71 | + | |
| 72 | + | longer explanation available when compiling with `-explain` |
| 73 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:33:12 ------------------------------------------------------ |
69 | 74 | 33 | person ++ (1, 2) match // error
|
70 |
| - | ^ |
71 |
| - | Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), Tuple] =:= (true : Boolean). |
| 75 | + | ^^^^^^ |
| 76 | + | Found: (Int, Int) |
| 77 | + | Required: NamedTuple.NamedTuple[N2, Tuple] |
| 78 | + | |
| 79 | + | where: N2 is a type variable with constraint <: Tuple |
| 80 | + | |
| 81 | + | longer explanation available when compiling with `-explain` |
72 | 82 | -- Error: tests/neg/named-tuples.scala:36:17 ---------------------------------------------------------------------------
|
73 | 83 | 36 | val bad = ("", age = 10) // error
|
74 | 84 | | ^^^^^^^^
|
|
103 | 113 | -- Warning: tests/neg/named-tuples.scala:25:29 -------------------------------------------------------------------------
|
104 | 114 | 25 | val (name = x, agee = y) = person // error
|
105 | 115 | | ^^^^^^
|
106 |
| - |pattern's type (String, Int) is more specialized than the right hand side expression's type (name : String, age : Int) |
| 116 | + | pattern's type (String, Int) does not match the right hand side expression's type (name : String, age : Int) |
107 | 117 | |
|
108 |
| - |If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, |
109 |
| - |which may result in a MatchError at runtime. |
110 |
| - |This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
| 118 | + | If the narrowing is intentional, this can be communicated by adding `: @unchecked` after the expression, |
| 119 | + | which may result in a MatchError at runtime. |
| 120 | + | This patch can be rewritten automatically under -rewrite -source 3.2-migration. |
0 commit comments