Skip to content

Conversation

thinhbuzz
Copy link
Contributor

@thinhbuzz thinhbuzz commented Jun 6, 2025

refer to commit d5f7dff

@thinhbuzz
Copy link
Contributor Author

Old

const value = await Il2Cpp.mainThread.schedule<number>(() => {
    return new Promise<number>(resolve => resolve(1));
});
// Error: TS2345: Argument of type () => Promise<number> is not assignable to parameter of type () => number

New

const value = await Il2Cpp.mainThread.schedule<number>(() => {
    return new Promise<number>(resolve => resolve(1));
});
// OK

@vfsfitvnm
Copy link
Owner

Hmm, schedule should not be async, but should handle Promises as well. What's your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants