@@ -618,48 +618,28 @@ defmodule Module.Types.Pattern do
618618  # This function is public as it is invoked from Of.binary/4. 
619619
620620  # :atom 
621-   def  of_guard ( atom ,  expected ,  expr ,  stack ,  context )  when  is_atom ( atom )  do 
622-     if  atom_type? ( expected ,  atom )  do 
623-       { atom ( [ atom ] ) ,  context } 
624-     else 
625-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  atom ( [ atom ] ) ,  stack ,  context ) } 
626-     end 
621+   def  of_guard ( atom ,  _expected ,  _expr ,  _stack ,  context )  when  is_atom ( atom )  do 
622+     { atom ( [ atom ] ) ,  context } 
627623  end 
628624
629625  # 12 
630-   def  of_guard ( literal ,  expected ,  expr ,  stack ,  context )  when  is_integer ( literal )  do 
631-     if  integer_type? ( expected )  do 
632-       { integer ( ) ,  context } 
633-     else 
634-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  integer ( ) ,  stack ,  context ) } 
635-     end 
626+   def  of_guard ( literal ,  _expected ,  _expr ,  _stack ,  context )  when  is_integer ( literal )  do 
627+     { integer ( ) ,  context } 
636628  end 
637629
638630  # 1.2 
639-   def  of_guard ( literal ,  expected ,  expr ,  stack ,  context )  when  is_float ( literal )  do 
640-     if  float_type? ( expected )  do 
641-       { float ( ) ,  context } 
642-     else 
643-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  float ( ) ,  stack ,  context ) } 
644-     end 
631+   def  of_guard ( literal ,  _expected ,  _expr ,  _stack ,  context )  when  is_float ( literal )  do 
632+     { float ( ) ,  context } 
645633  end 
646634
647635  # "..." 
648-   def  of_guard ( literal ,  expected ,  expr ,  stack ,  context )  when  is_binary ( literal )  do 
649-     if  binary_type? ( expected )  do 
650-       { binary ( ) ,  context } 
651-     else 
652-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  binary ( ) ,  stack ,  context ) } 
653-     end 
636+   def  of_guard ( literal ,  _expected ,  _expr ,  _stack ,  context )  when  is_binary ( literal )  do 
637+     { binary ( ) ,  context } 
654638  end 
655639
656640  # [] 
657-   def  of_guard ( [ ] ,  expected ,  expr ,  stack ,  context )  do 
658-     if  empty_list_type? ( expected )  do 
659-       { empty_list ( ) ,  context } 
660-     else 
661-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  empty_list ( ) ,  stack ,  context ) } 
662-     end 
641+   def  of_guard ( [ ] ,  _expected ,  _expr ,  _stack ,  context )  do 
642+     { empty_list ( ) ,  context } 
663643  end 
664644
665645  # [expr, ...] 
@@ -691,13 +671,9 @@ defmodule Module.Types.Pattern do
691671  end 
692672
693673  # <<>> 
694-   def  of_guard ( { :<<>> ,  _meta ,  args } ,  expected ,  expr ,  stack ,  context )  do 
695-     if  binary_type? ( expected )  do 
696-       context  =  Of . binary ( args ,  :guard ,  stack ,  context ) 
697-       { binary ( ) ,  context } 
698-     else 
699-       { error_type ( ) ,  Of . incompatible_error ( expr ,  expected ,  binary ( ) ,  stack ,  context ) } 
700-     end 
674+   def  of_guard ( { :<<>> ,  _meta ,  args } ,  _expected ,  _expr ,  stack ,  context )  do 
675+     context  =  Of . binary ( args ,  :guard ,  stack ,  context ) 
676+     { binary ( ) ,  context } 
701677  end 
702678
703679  # ^var 
0 commit comments