Skip to content

Automatically export identifiers used by inlined functions #2

@krispya

Description

@krispya

This code currently breaks since userCache and database are not exported and used in the lined functions.

// Mock dependencies for the test
const userCache = new Map();
const database = { users: [{ id: 1, name: 'John', active: true }] };

// Functions marked with @inline
export /* @inline */ function getUser(id: number) {
	return userCache.get(id) || database.users.find(u => u.id === id);
}

export /* @inline */ function getUserName(user: { name: string } | undefined) {
	return user?.name || 'Unknown';
} 

We should export these identifiers automatically in the first pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions