File tree Expand file tree Collapse file tree
emmylua_code_analysis/src/compilation/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -816,4 +816,17 @@ mod test {
816816 let result_ty = ws. expr_ty ( "result" ) ;
817817 assert_eq ! ( ws. humanize_type( result_ty) , "integer" ) ;
818818 }
819+
820+ #[ test]
821+ fn test_extends_true ( ) {
822+ let mut ws = VirtualWorkspace :: new ( ) ;
823+ assert ! ( ws. check_code_for(
824+ DiagnosticCode :: TypeNotFound ,
825+ r#"
826+ ---@alias TestA<T> T extends "test" and number or string
827+ ---@alias TestB<T> T extends true and number or string
828+ ---@alias TestC<T> T extends 111 and number or string
829+ "# ,
830+ ) ) ;
831+ }
819832}
Original file line number Diff line number Diff line change @@ -688,6 +688,9 @@ impl LuaDocLexer<'_> {
688688 ch if is_name_start ( ch) => {
689689 let ( text, _) = read_doc_name ( reader) ;
690690 match text {
691+ "true" => LuaTokenKind :: TkTrue ,
692+ "false" => LuaTokenKind :: TkFalse ,
693+ "nil" => LuaTokenKind :: TkNil ,
691694 "new" => LuaTokenKind :: TkDocNew ,
692695 _ => LuaTokenKind :: TkName ,
693696 }
You can’t perform that action at this time.
0 commit comments