File tree Expand file tree Collapse file tree 5 files changed +6
-5
lines changed
semantic_analysis/ast_node/expression/typed_expression Expand file tree Collapse file tree 5 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ impl<'a> FnCompiler<'a> {
457457 ) )
458458 }
459459
460- // Can be used to raw untyped slice and string slice
460+ // Can be used for raw untyped slice and string slice
461461 fn compile_slice (
462462 & mut self ,
463463 context : & mut Context ,
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ impl PartialEq for Literal {
9595 ( Self :: Numeric ( l0) , Self :: Numeric ( r0) ) => l0 == r0,
9696 ( Self :: Boolean ( l0) , Self :: Boolean ( r0) ) => l0 == r0,
9797 ( Self :: B256 ( l0) , Self :: B256 ( r0) ) => l0 == r0,
98+ ( Self :: Binary ( l0) , Self :: Binary ( r0) ) => l0 == r0,
9899 _ => false ,
99100 }
100101 }
Original file line number Diff line number Diff line change @@ -534,10 +534,10 @@ pub(crate) fn type_check_method_application(
534534 }
535535
536536 fn method_name_literal ( method_name : & BaseIdent ) -> Expression {
537- let method_name_str = method_name. as_str ( ) . to_string ( ) ;
537+ let method_name_str = method_name. as_str ( ) ;
538538 let len_bytes = ( method_name_str. len ( ) as u64 ) . to_be_bytes ( ) ;
539539
540- let mut blob = vec ! [ ] ;
540+ let mut blob = Vec :: with_capacity ( len_bytes . len ( ) + method_name_str . len ( ) ) ;
541541 blob. extend ( len_bytes) ;
542542 blob. extend ( method_name_str. as_bytes ( ) ) ;
543543
Original file line number Diff line number Diff line change @@ -1252,6 +1252,6 @@ fn literal_to_symbol_kind(value: &Literal) -> SymbolKind {
12521252 Literal :: String ( ..) => SymbolKind :: StringLiteral ,
12531253 Literal :: B256 ( ..) => SymbolKind :: ByteLiteral ,
12541254 Literal :: Boolean ( ..) => SymbolKind :: BoolLiteral ,
1255- Literal :: Binary ( _) => todo ! ( ) ,
1255+ Literal :: Binary ( _) => unreachable ! ( "literals cannot be expressed in the language yet" ) ,
12561256 }
12571257}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ fn literal_to_string(literal: &Literal) -> String {
6767 Literal :: String ( len) => format ! ( "str[{}]" , len. as_str( ) . len( ) ) ,
6868 Literal :: Boolean ( _) => "bool" . into ( ) ,
6969 Literal :: B256 ( _) => "b256" . into ( ) ,
70- Literal :: Binary ( _) => todo ! ( ) ,
70+ Literal :: Binary ( _) => unreachable ! ( "literals cannot be expressed in the language yet" ) ,
7171 }
7272}
7373
You can’t perform that action at this time.
0 commit comments