diff --git a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap index 42dfc0e33d..222a3c52f5 100644 --- a/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap +++ b/crates/ty_python_semantic/resources/mdtest/snapshots/typed_dict.md_-_`TypedDict`_-_Diagnostics_(e5289abf5c570c29).snap @@ -142,7 +142,7 @@ info: rule `invalid-key` is enabled by default ``` ``` -error[invalid-assignment]: Can not assign to key "id" on TypedDict `Employee` +error[invalid-assignment]: Cannot assign to key "id" on TypedDict `Employee` --> src/mdtest_snippet.py:33:5 | 32 | def write_to_readonly_key(employee: Employee): diff --git a/crates/ty_python_semantic/resources/mdtest/typed_dict.md b/crates/ty_python_semantic/resources/mdtest/typed_dict.md index 2bd173a8ed..f7e3edab4f 100644 --- a/crates/ty_python_semantic/resources/mdtest/typed_dict.md +++ b/crates/ty_python_semantic/resources/mdtest/typed_dict.md @@ -457,7 +457,7 @@ class Person(TypedDict, total=False): alice: Person = {"id": 1, "name": "Alice", "age": 30} alice["age"] = 31 # okay -# error: [invalid-assignment] "Can not assign to key "id" on TypedDict `Person`: key is marked read-only" +# error: [invalid-assignment] "Cannot assign to key "id" on TypedDict `Person`: key is marked read-only" alice["id"] = 2 ``` @@ -471,9 +471,9 @@ class Config(TypedDict): config: Config = {"host": "localhost", "port": 8080} -# error: [invalid-assignment] "Can not assign to key "host" on TypedDict `Config`: key is marked read-only" +# error: [invalid-assignment] "Cannot assign to key "host" on TypedDict `Config`: key is marked read-only" config["host"] = "127.0.0.1" -# error: [invalid-assignment] "Can not assign to key "port" on TypedDict `Config`: key is marked read-only" +# error: [invalid-assignment] "Cannot assign to key "port" on TypedDict `Config`: key is marked read-only" config["port"] = 80 ``` diff --git a/crates/ty_python_semantic/src/types/typed_dict.rs b/crates/ty_python_semantic/src/types/typed_dict.rs index e95535271e..b3fe37f867 100644 --- a/crates/ty_python_semantic/src/types/typed_dict.rs +++ b/crates/ty_python_semantic/src/types/typed_dict.rs @@ -165,7 +165,7 @@ pub(super) fn validate_typed_dict_key_assignment<'db, 'ast>( let typed_dict_d = typed_dict_ty.display(db); let mut diagnostic = builder.into_diagnostic(format_args!( - "Can not assign to key \"{key}\" on TypedDict `{typed_dict_d}`", + "Cannot assign to key \"{key}\" on TypedDict `{typed_dict_d}`", )); diagnostic.set_primary_message(format_args!("key is marked read-only"));