mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Add test case, correct existing test case
Existing: String assignment to a numeric indexer should succeed, not fail. (The baseline was already correct but the inline comment was wrong.) New: Boolean assignment to a numeric indexer should fail.
This commit is contained in:
@@ -6,5 +6,6 @@ y = x; // Ok because index signature type is any
|
||||
x = z; // Error
|
||||
z = x; // Ok because index signature type is any
|
||||
y = "foo"; // Error
|
||||
z = "foo"; // Error
|
||||
z = "foo"; // OK, string has numeric indexer
|
||||
z = false; // Error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user