Bug: `// @layout comb` attribute not getting applied
There was a bug reported on slack #ligo
That the layout comb was not getting applied in michelson
Hi!
It seems like the @layout:comb attribute doesn't work in Online IDE (JsLIGO). Or am I using it wrong?
https://ide.ligolang.org/p/1taV1xW_-7YNrhMrRDiryw
type action_t =
// @layout:comb
| ["A"]
| ["B", int]
| ["C", [int, int]];
type storage_t =
// @layout:comb
{
x: int,
y: int,
z: int
};
type return_t = [list<operation>, storage_t];
const main = (action: action_t, store: storage_t): return_t =>
[
list([]),
match(action, {
A: () => ({ x: 10, y: 10, z: 10 }),
B: (_) => ({ x: 20, y: 20, z: 20 }),
C: (_) => ({ x: 20, y: 20, z: 20 })
})
];
The current output:
{ parameter (or (or (unit %a) (int %b)) (pair %c int int)) ;
storage (pair (pair (int %x) (int %y)) (int %z)) ;
code { CAR ;
IF_LEFT
{ IF_LEFT
{ DROP ; PUSH int 10 ; PUSH int 10 ; PUSH int 10 }
{ DROP ; PUSH int 20 ; PUSH int 20 ; PUSH int 20 } }
{ DROP ; PUSH int 20 ; PUSH int 20 ; PUSH int 20 } ;
PAIR ;
PAIR ;
NIL operation ;
PAIR } }
Expected:
{ parameter (or (unit %a) (or (int %b) (pair %c int int))) ;
storage (pair (int %x) (int %y) (int %z)) ;
code { CAR ;
IF_LEFT
{ DROP ; PUSH int 10 ; PUSH int 10 ; PUSH int 10 }
{ IF_LEFT
{ DROP ; PUSH int 20 ; PUSH int 20 ; PUSH int 20 }
{ DROP ; PUSH int 20 ; PUSH int 20 ; PUSH int 20 } } ;
PAIR 3 ;
NIL operation ;
PAIR } }