Using template substitution in a function silently makes it unusable in a annotation
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
Current behavior
The following function:
export function ANIM_EXPAND_WIDTH(transitionMs: number = 200): AnimationEntryMetadata {
return trigger('expandWidth', [
state('void', style({
width: 0
})),
state('*', style({
width: '*'
})),
transition('void <=> *', animate(`${transitionMs}ms ease`))
]);
}
from a library causes the the error Error encountered resolving symbol values statically. Calling function 'ANIM_EXPAND_WIDTH'
with no indication as why it is not be used as a macro function.
The subtle change to:
export function ANIM_EXPAND_WIDTH(transitionMs: number = 200): AnimationEntryMetadata {
return trigger('expandWidth', [
state('void', style({
width: 0
})),
state('*', style({
width: '*'
})),
transition('void <=> *', animate(transitionMs+'ms ease'))
]);
}
works.
Expected behavior
Either this template substitution should be supported or a clear error message about why it can’t be supported should be reported.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
PEP 484 – Type Hints - Python Enhancement Proposals
In its basic form, type hinting is used by filling function annotation slots with classes: def greeting(name: str) -> str: return 'Hello '...
Read more >Why does this substitution failure create an error?
Your code is ill-formed (no diagnostic required) because the condition is always false regardless of the template argument, ...
Read more >Common Function Attributes (Using the GNU Compiler ...
The unavailable attribute results in an error if the function is used anywhere in the source file. This is useful when identifying functions...
Read more >Resolver mapping template programming guide - AWS AppSync
Resolver mapping template programming guide ... This is a cookbook-style tutorial of programming with the Apache Velocity Template Language (VTL) in AWS AppSync....
Read more >User Guide - Apache Velocity Engine
Velocity is a Java-based template engine. It permits web page designers to reference methods defined in Java code. Web designers can work in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is no longer an issue with Ivy 😃
Same error happens if we use a variable inside the function for example:
const transform: string = 'translate(0, 25%)';
and use this variable to avoid retyping the css value.Also using a switch will not work:
I feel like it should work. The parameters passed inside the function should be enough to resolve the value of the variable.