We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c9522d commit e464218Copy full SHA for e464218
test/compiler/irpasses.jl
@@ -1424,17 +1424,17 @@ end
1424
1425
# Test SROA of union into getfield
1426
struct SingleFieldStruct1
1427
- x::Int
+ x::Int
1428
end
1429
struct SingleFieldStruct2
1430
1431
1432
function foo(b, x)
1433
- if b
1434
- f = SingleFieldStruct1(x)
1435
- else
1436
- f = SingleFieldStruct2(x)
1437
- end
1438
- getfield(f, :x) + 1
+ if b
+ f = SingleFieldStruct1(x)
+ else
+ f = SingleFieldStruct2(x)
+ end
+ getfield(f, :x) + 1
1439
1440
@test foo(true, 1) == 2
0 commit comments