File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ def split_function_comment(
411411 is transformed into: ['int', 'str'], 'None'.
412412 """
413413 typ , _ = split_sub_comment (comment )
414- if "->" not in typ :
414+ if typ . count ( "->" ) != 1 :
415415 if not silent :
416416 print ("Invalid function type comment:" , comment , file = sys .stderr )
417417 return None
Original file line number Diff line number Diff line change @@ -374,6 +374,20 @@ def load_cache(self) -> bool:
374374 """ ,
375375 )
376376
377+ def test_invalid_return_type (self ) -> None :
378+ self .check (
379+ """
380+ def load_cache(x):
381+ # type: (str) -> bool -> invalid
382+ pass
383+ """ ,
384+ """
385+ def load_cache(x):
386+ # type: (str) -> bool -> invalid
387+ pass
388+ """ ,
389+ )
390+
377391 def test_combined_annotations_single (self ) -> None :
378392 self .check (
379393 """
You can’t perform that action at this time.
0 commit comments