Questions tagged [forward-reference]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

How to break circularities between two components in Angular

I'm trying to create a package doing npm run build, but I encountered the problem with the following error: error NG3003: One or more import cycles would need to be created to compile this component, ...
  • 1
0 votes
0 answers
20 views

How can I properly determine when a conditionally rendered child component's forwardRef is initialized?

I am working with a component which is wrapped with a ContainerLoading component which will conditionally render children with a forwardRef attached to one of the child components (TestChild) once ...
  • 3,401
0 votes
1 answer
33 views

why putting function inside forwardRef solves this error

currently I was facing this error forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component? any way by googling, I found solution for this, ...
0 votes
0 answers
220 views

Refactoring NestJs Modules and controller to avoid forwardRef

I have a project that is growing fast in NestJs. In the original architecture, 1 module have 1 controller et 1 service. The problem is that now, I have 10+ modules and it is full of forwardRef. In ...
  • 714
4 votes
0 answers
356 views

How to do double referencing in mongoose schema in Nestjs without forming a circular dependency?

author.module.ts @Module({ imports: [ forwardRef(() => ArticleModule), MongooseModule.forFeature([{ name: Author.name, schema: AuthorSchema }]), ], controllers: [AuthorController], ...
0 votes
0 answers
733 views

React.forwardRef warning but no ref passed or how to pass custom component to another component

I want to pass a custom input proponent to another proponent this way: <FormTextField name="startTime" label="startTime" type="time" error={!!...
  • 9
1 vote
1 answer
42 views

How to resolve the return type of a forwarding reference?

There is an existing expected<T,E> class which provides these typedefs and operators: value_type = T operator *(): expected<T,E>& -> value_type& const expected<...
1 vote
1 answer
71 views

Construct a Python class inside its method and different file

I want to construct an object from the same class in one of its methods. However, the method is in a different file. How can I do the following? file1.py class MyClass(): def __init__(self, i): ...
3 votes
1 answer
52 views

Why no overload chosen on forward reference for function templates?

Snippet: #include <iostream> template<typename T> struct Printer{}; template<typename T> void test(T&&) { std::cout << "Primary template called\n"; } ...
  • 3,469
0 votes
1 answer
61 views

Unnavoidable Illegal Forward Reference

I am having this issue I can't seem to resolve: I am trying to create a network of 'Location' objects. Each Location has a name and is connected to other 'adjacentLocations'. However, because it ...
1 vote
1 answer
485 views

Why is __future__.annotations (PEP 563) not backported to python3.6?

Does anyone know why PEP 563 is not backported to python36 as of the time of this writing? Are there any plans to do that or is it even possible? I am asking because I could use it for the codebase of ...
4 votes
1 answer
3k views

How can we use forwardRef in a angular service to avoid Circular dependency?

I have gone through couple of articles about resolving circular dependency in angular, all are mentioning about using forwardRef to resolve circular dependency. All the reference that I found online ...
  • 1,257
6 votes
1 answer
395 views

const forwarding reference gives error C2440: 'initializing': cannot convert from 'const std::string' to 'const std::string &&'

The following gives a compiler error: #include <string> const std::string& get_name(); int main(){ auto&& name1 = get_name();//should bind to whatever const auto&...
  • 10.4k
1 vote
1 answer
74 views

Forward reference (_telldir)

In the file /usr/include/dirent.h of MacOSX10.14 I see this line: struct _telldir; /* forward reference */ In the same file the identifier is used: struct _telldir *__dd_td; Nowhere else ...
0 votes
1 answer
315 views

Solving wrong forward reference error in scala [closed]

How to solve wrong forward reference error in scala. What exactly is that error means? def daysInMonth(year: Int, month: Int): Int = { val daysInMonth: Int = month match { case 1 => ...
  • 6,660
3 votes
1 answer
1k views

Pass forward ref through Redux Form?

I'm using Redux Forms: In Parent: class Parent extends React.Component { constructor(props) { super(props); this.myRef = React.createRef(); } componentDidMount() { console.log(...
  • 23k
4 votes
0 answers
332 views

react navigation props not working after adding react context

i have used react context to use the information of different component however, after adding a context and wrapping it with the current components is blocking the navigation props and stopped ...
5 votes
2 answers
2k views

ref doesn't have a value inside event handlers

Aimed functionality: When a user clicks a button, a list shows. When he clicks outside the list, it closes and the button should receive focus. (following accessibility guidelines) What I tried: ...
6 votes
1 answer
14k views

React Refs with TypeScript: Cannot read property 'current' of undefined

I'm building a React application using TypeScript. I want to create button, that scrolls to a header of a child component on my main page. I've created a ref in the child component, following this ...
  • 12.4k
0 votes
1 answer
87 views

std::forward to forward a funciton

I have the following code that just doesn't compile, particularly after it is being forwarded through std::forward struct TestParent { template< typename Fn > bool test( Fn&& fn ...
  • 89
6 votes
2 answers
13k views

React.forwardRef Causes Error with Styled Component

I am running React 16.3.1 and Styled Components 3.2.5 currently and am hitting an issue trying to use React.forwardRef. I have an Input component that is comprised of a wrapper div that holds the ...
  • 2,612
2 votes
3 answers
3k views

Forward reference in regex

What is the difference of the following regular expressions? (\2amigo|(go!))+ (amigo|(go!))+ They both match the same strings. https://regexr.com/3u62t How does the forward reference work?
  • 20.4k
20 votes
2 answers
13k views

what does do forwardRef in angular?

What does forwardRef do in angular, and what is its usage? here is an example: import {Component, Injectable, forwardRef} from '@angular/core'; export class ClassCL { value; } @Component({ ...
  • 2,459
3 votes
2 answers
329 views

about python recursive import in python3 when using type annotation

After spending another three hours, I thought I may got the solution.forward-references if there isn't any better way to do this, I'll close this question later and post that solution I'm doing ...
4 votes
3 answers
209 views

Internal working of static and non-static forward references in Java

I am working with forward references in Java and wondering why Java allows forward reference with either ClassName (in static variable) or with this reference in case of instance variable? What is the ...
  • 4,102
60 votes
5 answers
6k views

Why must I use the "this" keyword for forward references?

When I use the this keyword for accessing a non-static variable in a class, Java doesn't give any error. But when I don't use it, Java gives an error. Why must I use this? I know when should normally ...
  • 918
0 votes
1 answer
86 views

How reference deduce works?

May be duplicated to this. I read Effective Modern C++. Under Item 1, I found a case for universal reference: For the last example f(27); I did a test under VS2013. void process(int& x) { ...
  • 1,629
-1 votes
2 answers
607 views

Variadic templates with forward reference and operator +=

I have function which should taken several parameters and after add all parameters to *this, operator+= is overloaded and work for one parameter. Function look like template <typename T, typename ...
  • 1,755
0 votes
3 answers
568 views

Mutual recursion between objects in Python

I'm currently working on a module that allows users to build an arbitrary task network model (for use in a discrete event simulation) by creating instances of task objects (my module provides a task ...
  • 35
3 votes
1 answer
2k views

Java - Enums - Logical circular reference [duplicate]

Imagine the following made up example: public enum Hand { ROCK(SCISSORS), PAPER(ROCK), SCISSORS(PAPER); private final Hand beats; Hand(Hand beats) { this.beats = beats; } } I will ...
  • 4,217
2 votes
1 answer
263 views

Scala forward referencing

I'm new to Scala. I'm making a game and I have a list of locations that a character can visit, of type Location. I have a case class and a companion object to achieve this. LinkedLocations inside ...
8 votes
1 answer
690 views

Implementing a recursive structure using angular2 components (without forwardRef)?

I have a recursive structure that's composed of two components: OptionsMenuComponent (A menu) MenuItemComponent (The menu items) OptionsMenuComponent: (Template + Component) Template: <menu-...
1 vote
1 answer
61 views

C forward-referencing structures - 1) must be with a pointer? 2) must be initialized?

I'm trying to forward reference a (nested) structure, in C. That means I have a structure and in it I'm referencing to another structure that is declared later. If I declare the nested structure ...
5 votes
1 answer
5k views

Angular2 recursive components

I am trying to deploy recursive components as discussed in these posts and plnkr: How do I inject a parent component into a child component? > `http://plnkr.co/edit/l7jsV0k7DbGJGXPFlSPr?p=preview`...
0 votes
0 answers
438 views

Can a 2 Pass Assembler resolve Nested Forward References

I understand that if a symbol is forward referenced, the two pass assembler can solve it. But If there is a nested definition of a symbol e.g. D EQU A+C C EQU B+A B EQU A A WORD 10 Can this be ...
  • 485
2 votes
1 answer
2k views

Scala error: "forward reference extends over definition of value" when code appears in a function

I'm trying to compile the following code, using Scala 2.11.7. object LucasSeq { val fibo: Stream[Int] = 0 #:: 1 #:: fibo.zip(fibo.tail).map { pair => pair._1 + pair._2 } def firstKind(p:...
  • 7,214
0 votes
1 answer
133 views

Scala: Forward reference errors during type pattern matching

I'm looking to understand the compile-time errors generated by the following Scala code: class MyClass { def determineType(x:Any):String = { x match { case Int => "It's ...
  • 2,301
4 votes
1 answer
334 views

OpenCV for Android : Illegal Forward Reference

I am using OpenCV for my project and everything works fine except DescriptorExtractor.java. It gives me following error every day: /opencv/src/org/opencv/features2d/DescriptorExtractor.java Error:(26,...
  • 5,877
3 votes
1 answer
449 views

Scala forward reference of nested recursive function

I have this really simple method definition with a nested recursive function: def bar(arr : Array[Int]) : Int = { val foo : Int => Int = (i: Int) => if(i == 0) 0 else i + foo(i-1) foo(3) } ...
  • 105
58 votes
4 answers
22k views

Is there a generic way to memoize in Scala?

I wanted to memoize this: def fib(n: Int) = if(n <= 1) 1 else fib(n-1) + fib(n-2) println(fib(100)) // times out So I wrote this and this surprisingly compiles and works (I am surprised because ...
  • 32.2k
10 votes
0 answers
136 views

Why is using uninitialized variables allowed in Scala? [duplicate]

Possible Duplicate: Forward References - why does this code compile? Scala and forward references object Main extends App { val a = 4 val b = a + c val c = 5 println(b) // => 4 } ...
  • 5,052
3 votes
3 answers
1k views

A86 - definition conflicts with forward reference

I'm trying to use A86 to assemble some code for 8086. I narrowed my problem down to 4 lines of code. MOV BX, testz ADD AL, [testz] INT 20h testz: ~ ^ #ERROR 16: Definition Conflicts With ...
  • 1,560
4 votes
1 answer
8k views

How to handle forward references of XML IDREF with JAXB XmlAdapter during unmarshal?

Is it possible to handle forward references of XML IDREF elements in JAXB XmlAdapter during the unmarshal process? For example, I have the following XML complexType: <xs:complexType name="person"&...
  • 791
3 votes
1 answer
4k views

Forward reference extends over definition of value problem

i have some problem in scala to resolve implicit values, and i have the cryptic error message in netbeans : "error : Forward reference extends over definition of value ..." or in the scala ...
  • 523
4 votes
3 answers
1k views

C#'s compiler design - forward referencing

In forward referencing language such as c#, how does the compiler handle this? What are the steps in which the compiler operate?
  • 56.4k
6 votes
2 answers
1k views

How do I implement forward references in a compiler?

I'm creating a compiler with Lex and YACC (actually Flex and Bison). The language allows unlimited forward references to any symbol (like C#). The problem is that it's impossible to parse the language ...
  • 26.3k
14 votes
3 answers
23k views

What is the difference between forward declaration and forward reference?

What is the difference between forward declaration and forward reference? Forward declaration is, in my head, when you declare a function that isn't yet implemented, but is this incorrect? Do you have ...
  • 4,821
6 votes
6 answers
20k views

What is forward reference in C?

What is forward reference in C with respect to pointers? Can I get an example?
  • 13.3k