Top "Type-inference" questions

Type inference is the process of inferring types for programs automatically, using rules defined by a type system.

Checking if an object is a given type in Swift

I have an array that is made up of AnyObject. I want to iterate over it, and find all elements …

swift type-inference typechecking
Collections.emptyList() returns a List<Object>?

I'm having some trouble navigating Java's rule for inferring generic type parameters. Consider the following class, which has an optional …

java generics type-inference
Use of var keyword in C#

After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on …

c# type-inference var
The type arguments for method cannot be inferred from the usage

Maybe I'm overworked, but this isn't compiling (CS0411). Why? interface ISignatur<T> { Type Type { get; } } interface IAccess<…

c# type-inference
How to pass a class type as a function parameter

I have a generic function that calls a web service and serialize the JSON response back to an object. class …

swift generics type-inference
Calling static generic methods

I have come across a curious situation involving static generic methods. This is the code: class Foo<E> { …

java generics static type-inference
Swift 3 - How to verify class type of object

This line of code used to work with Swift 2, but now is incorrect in Swift 3. if gestureRecognizer.isMember(of: UITapGestureRecognizer) { } …

ios swift3 casting type-inference
Scala: How to define "generic" function parameters?

I am trying to learn Scala now, with a little bit of experience in Haskell. One thing that stood out …

scala haskell polymorphism type-inference
Why does using Collections.emptySet() with generics work in assignment but not as a method parameter?

So, I have a class with a constructor like this: public FilterList(Set<Integer> labels) { ... } and I want …

java generics collections type-inference
Why is Swift compile time so slow?

I'm using Xcode 6 Beta 6. This is something that's been bugging me for some time now, but it's reaching a point …

swift optimization compilation type-inference compilation-time