# US 2008/0313609 A1 · Core object-oriented type system for semi-structured data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0313609 A1
- Document ID: US20080313609A1
- Status: Published application
- Kind: A1
- Application number: 12/139,712
- Filed: 2008-06-16
- Published: 2008-12-18
- Earliest claimed: 2003-03-25
- Assignees: Microsoft Corporation
- Inventors: Erik Meijer; Wolfram Schulte; Barend H. Venter; Chia-Hsun Chen; Christopher J. Lovett; Matthew J. Wararen
- Web page: https://patentgrep.com/patent/US20080313609A1

## CPC

- G06F 8/437: {Type checking}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A type system employing structural subtyping is disclosed herein. A core type system supports several structural types, such as stream, choice, intersection and sequence. Also part of the core type system is a new invariant type, which denotes values whose dynamic type is the same as its static type, and type restrictions for limiting a range of a base type. Furthermore, a streamlined structural version of delegates, called structural delegates and a validation method thereof are introduce into the type system. To further facilitate type safety, strict statically checked interface casts are introduced.

## Claims

### Claim 1

A method of type checking a delegate comprising:
generating a wrapper based on a delegate; and
applying typing rules to the wrapper to determine whether the wrapper is well formed.

### Claim 2 (depends on 1)

The method of claim 1, wherein the delegate is a structural delegate.

### Claim 3 (depends on 2)

The method of claim 2, wherein generating a wrapper comprises converting a structural delegate into a nominal delegate.

### Claim 4 (depends on 1)

The method of claim 1, wherein the delegate is a nominal delegate.

### Claim 5 (depends on 1)

The method of claim 1, wherein generating a wrapper delegate comprises upcasting arguments.

### Claim 6

A method of statically type checking casting to an interface comprising:
determining a static type of a receiver expression seeking to be cast;
deducing whether the static type implements the interface specified; and
producing an error if the type does not implement the specified interface, otherwise converting the type to the interface.

### Claim 7

A program error detection system comprising:
means for receiving a program; and
means for utilizing type definitions and structural subtyping rules to determine whether the program is well formed within a meaning of the type definitions and subtyping rules.
