| 3041 | | if _expr.type inherits NilableType |
| 3042 | | _type = _expr.type |
| 3043 | | .compiler.warning(this, 'The given expression is already nilable so "to ?" is redundant. You can remove it.') # TODO: needs test case |
| 3044 | | else |
| 3045 | | _type = NilableType(_expr.type) |
| | 3041 | if not _expr.hasError |
| | 3042 | assert _expr.type |
| | 3043 | if _expr.type inherits NilableType |
| | 3044 | _type = _expr.type |
| | 3045 | .compiler.warning(this, 'The given expression is already nilable so "to ?" is redundant. You can remove it.') # TODO: needs test case |
| | 3046 | else |
| | 3047 | _type = .typeProvider.nilableType(_expr.type to !) |