|
| 1 | +conformant = "Partial" |
| 2 | +notes = """ |
| 3 | +Does not report error for a forward reference that is not enclosed in quotes. |
| 4 | +Incorrectly generates error for quoted type defined in class scope. |
| 5 | +Does not ignore newlines in multi-line unions |
| 6 | +""" |
| 7 | +conformance_automated = "Fail" |
| 8 | +errors_diff = """ |
| 9 | +Line 22: Expected 1 errors |
| 10 | +Line 23: Expected 1 errors |
| 11 | +Line 24: Expected 1 errors |
| 12 | +Line 25: Expected 1 errors |
| 13 | +Line 66: Expected 1 errors |
| 14 | +Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined'] |
| 15 | +Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type'] |
| 16 | +Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str"'] |
| 17 | +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int"'] |
| 18 | +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax'] |
| 19 | +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax', 'annotations_forward_refs.py:105: error: invalid syntax'] |
| 20 | +""" |
| 21 | +output = """ |
| 22 | +annotations_forward_refs.py:41: error: Invalid type comment or annotation |
| 23 | +annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type |
| 24 | +annotations_forward_refs.py:42: note: Did you mean "List[...]"? |
| 25 | +annotations_forward_refs.py:43: error: Syntax error in type annotation |
| 26 | +annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) |
| 27 | +annotations_forward_refs.py:44: error: Invalid type comment or annotation |
| 28 | +annotations_forward_refs.py:45: error: Invalid type comment or annotation |
| 29 | +annotations_forward_refs.py:46: error: Invalid type comment or annotation |
| 30 | +annotations_forward_refs.py:47: error: Invalid type comment or annotation |
| 31 | +annotations_forward_refs.py:48: error: Invalid type comment or annotation |
| 32 | +annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type |
| 33 | +annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases |
| 34 | +annotations_forward_refs.py:50: error: Invalid type comment or annotation |
| 35 | +annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? |
| 36 | +annotations_forward_refs.py:52: error: Invalid type comment or annotation |
| 37 | +annotations_forward_refs.py:53: error: Invalid type comment or annotation |
| 38 | +annotations_forward_refs.py:54: error: Invalid type comment or annotation |
| 39 | +annotations_forward_refs.py:55: error: Module "types" is not valid as a type |
| 40 | +annotations_forward_refs.py:55: note: Perhaps you meant to use a protocol matching the module structure? |
| 41 | +annotations_forward_refs.py:80: error: Name "ClassF" is not defined |
| 42 | +annotations_forward_refs.py:82: error: Name "str" is not defined |
| 43 | +annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type |
| 44 | +annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? |
| 45 | +annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type |
| 46 | +annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? |
| 47 | +annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" |
| 48 | +annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" |
| 49 | +annotations_forward_refs.py:104: error: invalid syntax |
| 50 | +annotations_forward_refs.py:105: error: invalid syntax |
| 51 | +annotations_forward_refs.py:105: error: invalid syntax |
| 52 | +""" |
0 commit comments