()
| 1319 | fn variant_names_may_repeat_across_enums() { |
| 1320 | // Two enums declare `Busy`; the qualifier picks one and match arms resolve |
| 1321 | // bare names against the scrutinee's enum. |
| 1322 | assert_exit( |
| 1323 | r#" |
| 1324 | enum Link { |
| 1325 | Idle |
| 1326 | Busy(i32) |
| 1327 | } |
| 1328 | |
| 1329 | enum Disk { |
| 1330 | Busy(i32) |
| 1331 | Spun |
| 1332 | } |
| 1333 | |
| 1334 | main: () -> i32 { |
| 1335 | l: Link = Link.Busy(40) |
| 1336 | d: Disk = Disk.Busy(2) |
| 1337 | a: i32 = match l { |
| 1338 | Busy(n) -> n |
| 1339 | Idle -> 0 |
| 1340 | } |
| 1341 | b: i32 = match d { |
| 1342 | Busy(n) -> n |
| 1343 | Spun -> 0 |
nothing calls this directly
no test coverage detected