首页    期刊浏览 2024年12月05日 星期四
登录注册

文章基本信息

  • 标题:Static Typing of Complex Presence Constraints in Interfaces
  • 作者:Nathalie Oostvogels ; Joeri De Koster ; Wolfgang De Meuter
  • 期刊名称:LIPIcs : Leibniz International Proceedings in Informatics
  • 电子版ISSN:1868-8969
  • 出版年度:2018
  • 卷号:109
  • 页码:14:1-14:27
  • DOI:10.4230/LIPIcs.ECOOP.2018.14
  • 出版社:Schloss Dagstuhl -- Leibniz-Zentrum fuer Informatik
  • 摘要:Many functions in libraries and APIs have the notion of optional parameters, which can be mapped onto optional properties of an object representing those parameters. The fact that properties are optional opens up the possibility for APIs and libraries to design a complex "dependency logic" between properties: for example, some properties may be mutually exclusive, some properties may depend on others, etc. Existing type systems are not strong enough to express such dependency logic, which can lead to the creation of invalid objects and accidental usage of absent properties. In this paper we propose TypeScriptIPC: a variant of TypeScript with a novel type system that enables programmers to express complex presence constraints on properties. We prove that it is sound with respect to enforcing complex dependency logic defined by the programmer when an object is created, modified or accessed.
  • 关键词:type checking; interfaces; dependency logic
Loading...
联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有