Constructs a type representing some expression that normally forms an invalid type. For example, if we see a type hint that says "3 + 4", we would transform that expression into a RawExpressionType. The semantic analysis layer will report an "Invalid type" error when it
(self, node: AST, note: str | None = None)
| 1897 | return self.override_column |
| 1898 | |
| 1899 | def invalid_type(self, node: AST, note: str | None = None) -> RawExpressionType: |
| 1900 | """Constructs a type representing some expression that normally forms an invalid type. |
| 1901 | For example, if we see a type hint that says "3 + 4", we would transform that |
| 1902 | expression into a RawExpressionType. |
| 1903 | |
| 1904 | The semantic analysis layer will report an "Invalid type" error when it |
| 1905 | encounters this type, along with the given note if one is provided. |
| 1906 | |
| 1907 | See RawExpressionType's docstring for more details on how it's used. |
| 1908 | """ |
| 1909 | return RawExpressionType( |
| 1910 | None, "typing.Any", line=self.line, column=getattr(node, "col_offset", -1), note=note |
| 1911 | ) |
| 1912 | |
| 1913 | @overload |
| 1914 | def visit(self, node: ast3.expr) -> ProperType: ... |
no test coverage detected