()
| 2095 | #[test] |
| 2096 | fn inline_constructed_enum_as_call_argument() { |
| 2097 | // A freshly constructed enum passed directly as a call argument. 7 * 7 = 49. |
| 2098 | assert_exit( |
| 2099 | r#" |
| 2100 | enum Shape { |
| 2101 | Circle(i32) |
| 2102 | Rect(i32, i32) |
| 2103 | Empty |
| 2104 | } |
| 2105 | |
| 2106 | area: (s: Shape) -> i32 { |
| 2107 | match s { |
| 2108 | Circle(r) -> { |
| 2109 | return r * r |
| 2110 | } |
| 2111 | Rect(w, h) -> { |
| 2112 | return w * h |
| 2113 | } |
| 2114 | Empty -> { |
nothing calls this directly
no test coverage detected