You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code like editor.commands.on('afterExec', ({ editor, command }) => { /* ... */ }) no longer knows the type of editor (Ace.Editor) or command (Ace.Command).
Expected Behavior
Code like editor.commands.on('afterExec', ({ editor, command }) => { /* ... */ }) knows the type of editor (Ace.Editor) or command (Ace.Command).
import{Ace}from'ace-builds';// ==========// https://stackoverflow.com/a/58779181/155423typeIsAny<T>=unknownextendsT ? Textends{} ? T : never : never;typeNotAny<T>=TextendsIsAny<T> ? never : T;functionnotAny<T>(x: NotAny<T>){}// ==========functionexample(editor: Ace.Editor){editor.commands.on('afterExec',({ editor, command })=>{notAny(editor);notAny(command);});}
Run the project
pnpm tsc index.ts
Upgrade to 1.37.5, run project again
pnpm tsc index.ts
index.ts:16:12 - error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'.
16 notAny(editor);
~~~~~~
index.ts:17:12 - error TS2345: Argument of type 'any' is not assignable to parameter of type 'never'.
17 notAny(command);
~~~~~~~
Possible Solution
No response
Additional Information/Context
Going only by the changelog entry, the changes from @mkslanc in #5427 seem likely to be relevant.
Ace Version / Browser / OS / Keyboard layout
Ace 1.37.5 / TypeScript 5.7
The text was updated successfully, but these errors were encountered:
Describe the bug / Current Behavior
Code like
editor.commands.on('afterExec', ({ editor, command }) => { /* ... */ })
no longer knows the type ofeditor
(Ace.Editor
) orcommand
(Ace.Command
).Expected Behavior
Code like
editor.commands.on('afterExec', ({ editor, command }) => { /* ... */ })
knows the type ofeditor
(Ace.Editor
) orcommand
(Ace.Command
).Reproduction Steps
Create a basic TypeScript project
tsconfig.json
package.json
index.ts
Run the project
Upgrade to 1.37.5, run project again
Possible Solution
No response
Additional Information/Context
Going only by the changelog entry, the changes from @mkslanc in #5427 seem likely to be relevant.
Ace Version / Browser / OS / Keyboard layout
Ace 1.37.5 / TypeScript 5.7
The text was updated successfully, but these errors were encountered: