Skip to content

Metadata extractor treats "function" differently than a lambda #13853

Closed

Description

@jelbourn

The metadata extractor allows this:

export function FACTORY(parentDispatcher: ViewportRuler) {
  return parentDispatcher || new ViewportRuler();
};

But not this:

export const FACTORY = (parentDispatcher: ViewportRuler) => {
  return parentDispatcher || new ViewportRuler();
};

The latter results in

Error: Error encountered resolving symbol values statically. 
Function calls are not supported. 
Consider replacing the function or lambda with a reference to an exported function 
(position 59:48 in the original .ts file), 
resolving symbol VIEWPORT_RULER_PROVIDER_FACTORY in...

Note from @chuckjaz:

The reason we don't today is because we blindly inline local references. 
What we should should only conditionally inline (simplify) exported constants.

Activity

  1. DzmitryShylovich commented on Jan 10, 2017

    @DzmitryShylovich
    Contributor

    Duplicate of #13614

  2. added this to the needsTriage milestone on Feb 28, 2018
  3. angular-automatic-lock-bot commented on Sep 14, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions