About 8,370,000 results
Open links in new tab
  1. typescript - How to define type for a function callback (as any ...

    Note that ESLint gives some advice against using Function as a type directly -- quote "Don't use Function as a type. The Function type accepts any function-like value. It provides no type safety …

  2. How to declare Return Types for Functions in TypeScript

    The TypeScript compiler will infer types when it can, and this is done you do not need to specify explicit types. so for the greeter example, greet () returns a string literal, which tells the compiler that the type …

  3. How can I specify the function type in my type hints?

    Jun 15, 2016 · How can I specify the type hint of a variable as a function type? There is no typing.Function, and I could not find anything in the relevant PEP, PEP 483.

  4. Working with function types in Go - Stack Overflow

    If two functions have the same signature (parameter and result types), they share one function type. By writing type Greeting func... you're just giving a name to a particular function type, not defining a new …

  5. Is there a Function type in C#? - Stack Overflow

    Aug 21, 2009 · There's also two generic types of delegate types defined in the base class library, one for methods that return a value, and one for those who doesn't, and they come with variations over how …

  6. How do Python functions handle the types of parameters that you pass …

    Apr 7, 2017 · Python doesn't know that you are calling the function with the proper types, and expects the programmer to take care of that. If your function will be called with different types of parameters, …

  7. How to specify multiple types using type-hints - Stack Overflow

    I have a function in python that can either return a bool or a list. Is there a way to specify the types using type hints? For example, is this the correct way to do it? def foo (id) -> list or b...

  8. What is the syntax for Typescript arrow functions with generics?

    Aug 31, 2015 · When using <T> inside the function body, this did not work for me. Typescript tells me <T> isn't used for the <T> at the function definition location and tells me that it cannot find <T> at the …

  9. Casting a function pointer to another type - Stack Overflow

    Calling a function pointer boils down to pushing the arguments on the stack and doing an indirect jump to the function pointer target, and there's obviously no notion of types at the machine code level. …

  10. c++11 - C++ function types - Stack Overflow

    Jul 3, 2013 · I have a problem understanding function types (they appear e.g. as the Signature template parameter of a std::function): typedef int Signature(int); // the signature in question typedef std::func...