summaryrefslogtreecommitdiff
path: root/Notes/Typeck.txt
blob: 0cd7f27ef1b6e78887eecc77ff6eb7374d9d2cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Type inferrence


# Type equality procedure

## Requirements
- Called to indicate that two types (passed as `const ::HIR::TypeRef&` from the HIR) must be the same
- Must handle cases where either of the passed typerefs point to aliased inferrence vars

## Rough procedure
- Locate real type pointed to by both arguments
- If neither have concrete information, alias the right to the left
- If both are concrete, ensure that both are equal (recursing for infer)
- If only one is concrete, alias the infer to it


# Code Elements

## Function/Method references

Needs to be able to point to functions in:
- Root namespace (with parameters)
- Trait (with two sets of parameters)
- Type impl block (with two sets of parameters)
- NOTE: Don't need to worry about trait impl blocks?
 - What about handling an associated type return (fully known)


Maybe can use separate types for each usecase?
- 

<!-- vim: ft=markdown
-->