-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.help wantedContributions especially welcomeContributions especially welcome
Description
Summary
Playground link: https://play.ty.dev/95591965-0266-4a59-9952-4e8be99ee67c
from pathlib import Path
def setup_test_project(registry_name: str, registry_url: str, project_dir: str) -> Path:
pyproject_file = Path(project_dir) / "pyproject.toml"
pyproject_file.write_text("...", encoding="utf-8")The error to me implies that I need to use None | Path when the function can never return Path at all and I should replaced Path with None instead
error[invalid-return-type]: Function can implicitly return `None`, which is not assignable to return type `Path`
--> script.py:64:84
|
64 | def setup_test_project(registry_name: str, registry_url: str, project_dir: str) -> Path:
| ^^^^
65 | pyproject_file = Path(project_dir) / "pyproject.toml"
66 | pyproject_file.write_text("...", encoding="utf-8")
|
info: rule `invalid-return-type` is enabled by default
Version
ty 0.0.1-alpha.7
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
diagnosticsRelated to reporting of diagnostics.Related to reporting of diagnostics.help wantedContributions especially welcomeContributions especially welcome