A type system for dynamic instances