pub fn desugar_class(ast: &AST, imp: &mut Imports, state: &State) -> DesugarResult {
    match &ast.node {
        Node::TypeAlias { ty, isa, .. } => {
            let parents = vec![isa.deref().clone()];
            let body = None;
            extract_class(ty, &body, &[], &parents, imp, &state.in_interface(true))
        }
        Node::TypeDef { ty, body, isa } => {
            let parents = if let Some(isa) = isa { vec![isa.deref().clone()] } else { vec![] };
            extract_class(ty, body, &[], &parents, imp, &state.in_interface(true))
        }
        Node::Class { ty, body, args, parents } =>
            extract_class(ty, body, args, parents, imp, &state.in_interface(false)),

        other => panic!("Expected class or type definition but was {:?}", other)
    }
}
/// Desugar a class.
///
/// If a class has inline arguments (arguments next to class), then we create a
/// constructor and assume that there is no constructor in the body of a class.
/// This property should be ensured by the type checker.
///
/// We add arguments and calls to super for parents.
Desugar a class.
If a class has inline arguments (arguments next to class), then we create a
constructor and assume that there is no constructor in the body of a class.
This property should be ensured by the type checker.

We add arguments and calls to super for parents.
Desugar a class . If a class has inline arguments ( arguments next to class ) then we create a constructor and assume that there is no constructor in the body of a class . This property should be ensured by the type checker . We add arguments and calls to super for parents .
pub fn desugar_class(ast: &AST, imp: &mut Imports, state: &State) -> DesugarResult {
    match &ast.node {
        Node::TypeAlias { ty, isa, .. } => {
            let parents = vec![isa.deref().clone()];
            let body = None;
            extract_class(ty, &body, &[], &parents, imp, &state.in_interface(true))
        }
        Node::TypeDef { ty, body, isa } => {
            let parents = if let Some(isa) = isa { vec![isa.deref().clone()] } else { vec![] };
            extract_class(ty, body, &[], &parents, imp, &state.in_interface(true))
        }
        Node::Class { ty, body, args, parents } =>
            extract_class(ty, body, args, parents, imp, &state.in_interface(false)),
        other => panic!("Expected class or type definition but was {:?}", other)
    }
}
pub fn desugar_class ( ast : & AST , imp : & mut Imports , state : & State ) -> DesugarResult { match & ast . node { Node :: TypeAlias { ty , isa , .. } => { let parents = vec ! [ isa deref ( ) clone ( ) ] ; let body = None ; extract_class ( ty , & body , & [ ] , & parents , imp , & state . in_interface ( true ) ) } Node :: TypeDef { ty , body , isa } => { let parents = if let Some ( isa ) = isa { vec ! [ isa deref ( ) clone ( ) ] } else { vec ! [ ] } ; extract_class ( ty , body , & [ ] , & parents , imp , & state . in_interface ( true ) ) } Node :: Class { ty , body , args , parents } => extract_class ( ty , body , args , parents , imp , & state . in_interface ( false ) ) , other => panic ! ( " " other ) } }
Desugar a class.
Desugar a class .
ast
&AST
imp
&mut Imports
state
&State