Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. Variance and Generalized Constraints for C# Generics
 
conference paper

Variance and Generalized Constraints for C# Generics

Kennedy, Andrew
•
Russo, Claudio
•
Emir, Burak  
Show more
2006
Proc. of ECOOP 2006
European Conference on Object-Oriented Programming (ECOOP)

Generic types in C# behave invariantly with respect to subtyping. We propose a system of type-safe variance for C# that supports the declaration of covariant and contravariant type parameters on generic types. To support more widespread application of variance we also generalize the existing constraint mechanism with arbitrary subtype assertions on classes and methods. This extension is useful even in the absence of variance, and subsumes equational constraints proposed for Generalized Algebraic Data Types (GADTs). We formalize the subtype relation in both declarative and syntax-directed style, and describe and prove the correctness of algorithms for constraint closure and subtyping. Finally, we formalize and prove a type safety theorem for a featherweight language with variant classes and generalized constraints.

  • Details
  • Metrics
Type
conference paper
Web of Science ID

WOS:000239558900017

Author(s)
Kennedy, Andrew
Russo, Claudio
Emir, Burak  
Yu, Dachuan
Date Issued

2006

Published in
Proc. of ECOOP 2006
Subjects

variance

•

generics

•

constraints

URL

URL

http://ecoop.org
Editorial or Peer reviewed

REVIEWED

Written at

OTHER

EPFL units
LAMP1  
Event nameEvent placeEvent date
European Conference on Object-Oriented Programming (ECOOP)

Nantes

July 3-7

Available on Infoscience
May 1, 2006
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/230008
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés