|
21 | 21 | | Required: (String, Int) |
22 | 22 | | |
23 | 23 | | longer explanation available when compiling with `-explain` |
24 | | --- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:19:20 ------------------------------------------------------ |
25 | | -19 | val _: NameOnly = person // error |
| 24 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:19:25 ------------------------------------------------------ |
| 25 | +19 | val _: (String, Int) = (name = "", age = 0) // error |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 27 | + | Found: (name : String, age : Int) |
| 28 | + | Required: (String, Int) |
| 29 | + | |
| 30 | + | longer explanation available when compiling with `-explain` |
| 31 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:20:20 ------------------------------------------------------ |
| 32 | +20 | val _: NameOnly = person // error |
26 | 33 | | ^^^^^^ |
27 | 34 | | Found: (Test.person : (name : String, age : Int)) |
28 | 35 | | Required: Test.NameOnly |
29 | 36 | | |
30 | 37 | | longer explanation available when compiling with `-explain` |
31 | | --- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:20:18 ------------------------------------------------------ |
32 | | -20 | val _: Person = nameOnly // error |
| 38 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:21:18 ------------------------------------------------------ |
| 39 | +21 | val _: Person = nameOnly // error |
33 | 40 | | ^^^^^^^^ |
34 | 41 | | Found: (Test.nameOnly : (name : String)) |
35 | 42 | | Required: Test.Person |
36 | 43 | | |
37 | 44 | | longer explanation available when compiling with `-explain` |
38 | | --- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:22:36 ------------------------------------------------------ |
39 | | -22 | val _: (age: Int, name: String) = person // error |
| 45 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:23:36 ------------------------------------------------------ |
| 46 | +23 | val _: (age: Int, name: String) = person // error |
40 | 47 | | ^^^^^^ |
41 | 48 | | Found: (Test.person : (name : String, age : Int)) |
42 | 49 | | Required: (age : Int, name : String) |
43 | 50 | | |
44 | 51 | | longer explanation available when compiling with `-explain` |
45 | | --- Error: tests/neg/named-tuples.scala:24:17 --------------------------------------------------------------------------- |
46 | | -24 | val (name = x, agee = y) = person // error |
| 52 | +-- Error: tests/neg/named-tuples.scala:25:17 --------------------------------------------------------------------------- |
| 53 | +25 | val (name = x, agee = y) = person // error |
47 | 54 | | ^^^^^^^^ |
48 | 55 | | No element named `agee` is defined in selector type (name : String, age : Int) |
49 | | --- Error: tests/neg/named-tuples.scala:27:10 --------------------------------------------------------------------------- |
50 | | -27 | case (name = n, age = a) => () // error // error |
| 56 | +-- Error: tests/neg/named-tuples.scala:28:10 --------------------------------------------------------------------------- |
| 57 | +28 | case (name = n, age = a) => () // error // error |
51 | 58 | | ^^^^^^^^ |
52 | 59 | | No element named `name` is defined in selector type (String, Int) |
53 | | --- Error: tests/neg/named-tuples.scala:27:20 --------------------------------------------------------------------------- |
54 | | -27 | case (name = n, age = a) => () // error // error |
| 60 | +-- Error: tests/neg/named-tuples.scala:28:20 --------------------------------------------------------------------------- |
| 61 | +28 | case (name = n, age = a) => () // error // error |
55 | 62 | | ^^^^^^^ |
56 | 63 | | No element named `age` is defined in selector type (String, Int) |
57 | | --- [E172] Type Error: tests/neg/named-tuples.scala:29:27 --------------------------------------------------------------- |
58 | | -29 | val pp = person ++ (1, 2) // error |
| 64 | +-- [E172] Type Error: tests/neg/named-tuples.scala:30:27 --------------------------------------------------------------- |
| 65 | +30 | val pp = person ++ (1, 2) // error |
59 | 66 | | ^ |
60 | 67 | | Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), Tuple] =:= (true : Boolean). |
61 | | --- [E172] Type Error: tests/neg/named-tuples.scala:32:18 --------------------------------------------------------------- |
62 | | -32 | person ++ (1, 2) match // error |
| 68 | +-- [E172] Type Error: tests/neg/named-tuples.scala:33:18 --------------------------------------------------------------- |
| 69 | +33 | person ++ (1, 2) match // error |
63 | 70 | | ^ |
64 | 71 | | Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), Tuple] =:= (true : Boolean). |
65 | | --- Error: tests/neg/named-tuples.scala:35:17 --------------------------------------------------------------------------- |
66 | | -35 | val bad = ("", age = 10) // error |
| 72 | +-- Error: tests/neg/named-tuples.scala:36:17 --------------------------------------------------------------------------- |
| 73 | +36 | val bad = ("", age = 10) // error |
67 | 74 | | ^^^^^^^^ |
68 | 75 | | Illegal combination of named and unnamed tuple elements |
69 | | --- Error: tests/neg/named-tuples.scala:38:20 --------------------------------------------------------------------------- |
70 | | -38 | case (name = n, age) => () // error |
| 76 | +-- Error: tests/neg/named-tuples.scala:39:20 --------------------------------------------------------------------------- |
| 77 | +39 | case (name = n, age) => () // error |
71 | 78 | | ^^^ |
72 | 79 | | Illegal combination of named and unnamed tuple elements |
73 | | --- Error: tests/neg/named-tuples.scala:39:16 --------------------------------------------------------------------------- |
74 | | -39 | case (name, age = a) => () // error |
| 80 | +-- Error: tests/neg/named-tuples.scala:40:16 --------------------------------------------------------------------------- |
| 81 | +40 | case (name, age = a) => () // error |
75 | 82 | | ^^^^^^^ |
76 | 83 | | Illegal combination of named and unnamed tuple elements |
77 | | --- Error: tests/neg/named-tuples.scala:42:10 --------------------------------------------------------------------------- |
78 | | -42 | case (age = x) => // error |
| 84 | +-- Error: tests/neg/named-tuples.scala:43:10 --------------------------------------------------------------------------- |
| 85 | +43 | case (age = x) => // error |
79 | 86 | | ^^^^^^^ |
80 | 87 | | No element named `age` is defined in selector type Tuple |
81 | | --- [E172] Type Error: tests/neg/named-tuples.scala:44:27 --------------------------------------------------------------- |
82 | | -44 | val p2 = person ++ person // error |
| 88 | +-- [E172] Type Error: tests/neg/named-tuples.scala:45:27 --------------------------------------------------------------- |
| 89 | +45 | val p2 = person ++ person // error |
83 | 90 | | ^ |
84 | 91 | |Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), (("name" : String), ("age" : String))] =:= (true : Boolean). |
85 | | --- [E172] Type Error: tests/neg/named-tuples.scala:45:43 --------------------------------------------------------------- |
86 | | -45 | val p3 = person ++ (first = 11, age = 33) // error |
| 92 | +-- [E172] Type Error: tests/neg/named-tuples.scala:46:43 --------------------------------------------------------------- |
| 93 | +46 | val p3 = person ++ (first = 11, age = 33) // error |
87 | 94 | | ^ |
88 | 95 | |Cannot prove that Tuple.Disjoint[(("name" : String), ("age" : String)), (("first" : String), ("age" : String))] =:= (true : Boolean). |
89 | | --- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:47:22 ------------------------------------------------------ |
90 | | -47 | val p5 = person.zip(first = 11, age = 33) // error |
| 96 | +-- [E007] Type Mismatch Error: tests/neg/named-tuples.scala:48:22 ------------------------------------------------------ |
| 97 | +48 | val p5 = person.zip(first = 11, age = 33) // error |
91 | 98 | | ^^^^^^^^^^^^^^^^^^^^ |
92 | 99 | | Found: (first : Int, age : Int) |
93 | 100 | | Required: NamedTuple.NamedTuple[(("name" : String), ("age" : String)), Tuple] |
94 | 101 | | |
95 | 102 | | longer explanation available when compiling with `-explain` |
96 | | --- Warning: tests/neg/named-tuples.scala:24:29 ------------------------------------------------------------------------- |
97 | | -24 | val (name = x, agee = y) = person // error |
| 103 | +-- Warning: tests/neg/named-tuples.scala:25:29 ------------------------------------------------------------------------- |
| 104 | +25 | val (name = x, agee = y) = person // error |
98 | 105 | | ^^^^^^ |
99 | 106 | |pattern's type (String, Int) is more specialized than the right hand side expression's type (name : String, age : Int) |
100 | 107 | | |
|
0 commit comments