Top "Typechecking" questions

A typechecker enforces that expressions in a given programming language are well typed -- i.e. conform to the rules of a particular type system.

Checking type parameter of a generic method in C#

Is it possible to do something like this in C#: public void DoSomething<T>(T t) { if (T …

c# generics typechecking
Type checking in C++

In C++, I want to know whether the actual type of the object is from the same class, not the …

c++ casting typechecking
How Can I Check an Object to See its Type and Return A Casted Object

I have method to which I pass an object. In this method I check it's type and depending on the …

scala casting typechecking
Android Studio's "expected resource of type" checks?

Android Studio Beta (0.8) has a nifty new feature where it checks that some int parameters are not arbitrary integers, but …

android android-studio lint typechecking
Use isinstance to test for Unicode string

How can I do something like: >>> s = u'hello' >>> isinstance(s,str) False But I …

python unicode typechecking
how to check if a variable is of type enum in python

I have an enum like this @enum.unique class TransactionTypes(enum.IntEnum): authorisation = 1 balance_adjustment = 2 chargeback = 3 auth_reversal = 4 Now i …

python-2.7 enums typechecking
Check if something is a list

What is the easiest way to check if something is a list? A method doSomething has the parameters a and …

python typechecking
TypeScript: how to declare array of fixed size for type checking at Compile Time

Update: These checks are meant for compile time, not at runtime. In my example, the failed cases are all caught …

javascript typescript typechecking
Python -- Check if object is instance of any class from a certain module

Need a way to check if an object is an instance of any class in some particular module. I know …

python class types module typechecking
Swift -- Require classes implementing protocol to be subclasses of a certain class

I'm creating several NSView classes, all of which support a special operation, which we'll call transmogrify. At first glance, this …

inheritance swift interface protocols typechecking