Open asterkin opened 5 months ago
Hi,
This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!
Use Case
I'm developing a custom utilities class and want it to be equally accessible in inflight and preflight modes. For example, pub enum DatetimeFormat { ISO, MMYYYY, YYYYMMDD_HHMM }
pub class Util { extern "./lib.js" static pub inflight toUtcString(date: std.Datetime): str; extern "./lib.js" static pub inflight plus(date: std.Datetime, offset: duration): std.Datetime; extern "./lib.js" static pub inflight minus(date: std.Datetime, offset: duration): std.Datetime; extern "./lib.js" static pub inflight format(date: std.Datetime, format: DatetimeFormat): str; extern "./lib.js" static pub inflight parse(date: str, format: DatetimeFormat): std.Datetime; extern "./lib.js" static pub inflight formatMMYYYY(date: std.Datetime): str; extern "./lib.js" static pub inflight parseMMYYYY(sd: str): std.Datetime; extern "./lib.js" static pub inflight formatYYYYMMDD_HHMM(date: std.Datetime): str; extern "./lib.js" static pub inflight parseYYYYMMDD_HHMM(sd: str): std.Datetime; } provides some additional computations for the std.Datetime class. All functions are defined as inflight which is their primary usage. However, I cannot use them in test setups since inflight functions cannot be called in the preflight context. This limitation leads to extra boilerplate code to be written.
Proposed Solution
Implementation Notes
The implementation already exists for Wing standard libraries. Just need to make it accessible for potential contributors.
Component
Compiler
Community Notes