|
| 1 | +[case noErrorComment] |
| 2 | +x: int = 1 |
| 3 | + |
| 4 | +[case prototypicalErrorComment] |
| 5 | +x: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 6 | + |
| 7 | +[case emptyLineErrorComment-xfail] |
| 8 | +# E: |
| 9 | + |
| 10 | +[case oddErrorComments] |
| 11 | +x: int = "hi"#E: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 12 | +x2: int = "hi" #E: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 13 | +x3: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 14 | +x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 15 | +x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 16 | +x6: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 17 | +x7: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 18 | +x8: int = "hi" \ |
| 19 | + # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 20 | +x82: int = "hi"\ |
| 21 | +# E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 22 | + |
| 23 | +[case oddErrorCommentsNoteComment] |
| 24 | +n: int |
| 25 | +reveal_type(n) # N: Revealed type is "builtins.int" |
| 26 | + |
| 27 | + |
| 28 | +[case oddErrorCommentsThatDontWork-xfail] |
| 29 | +-- The space between the ":" and the message actually differs in the output, which we match against |
| 30 | +-- so we can't just parse it and replace it; therefore, these do not work. |
| 31 | +x: int = "hi"#E:Incompatible types in assignment (expression has type "str", variable has type "int") |
| 32 | +x2: int = "hi" #E:Incompatible types in assignment (expression has type "str", variable has type "int") |
| 33 | +x3: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 34 | +x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 35 | +x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int") |
| 36 | + |
| 37 | +[case oddErrorCommentsThatDontWorkCase-xfail] |
| 38 | +-- I just didn't bother to implement these. |
| 39 | +x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 40 | +x: int = "hi" # w: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 41 | +x: int = "hi" # n: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 42 | + |
| 43 | + |
| 44 | +[case oddErrorCommentsThatDontWorkCaseAndNoColon-xfail] |
| 45 | +-- I didn't implment these. This is veering towards the ambiguous. |
| 46 | +x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int") |
| 47 | +x2: int = "hi" # E Incompatible types in assignment (expression has type "str", variable has type "int") |
| 48 | +x3: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int") |
| 49 | +x4: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int") |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
0 commit comments