Files
boring-lang/notes.txt
2021-06-13 10:38:13 -06:00

59 lines
873 B
Plaintext

# On types
Type Usage != Type Definition
type List[T] struct {
}
fn add[T: addable](a: T, b: T): T {
return a + b;
}
type usages:
List[Int64]
fn(int, int): List[Int64]
@dataclass
class TypeUsage:
result: Identifier # Result of useage - either is the type, or is the return value if it's a function
type_args: List[Type] # Generics
arguments: Optional[List[Type]] # Specified if it is a function, this is how you tell if it's a function
if / match return never if all blocks return never;
blocks propagate never except at the function level;
TODO:
* ~Float Literals~
* ~Block expression~
* ~Return keyword~
* ~Normal assignment~
* ~Structs~
* ~Define~
* ~Literal~
* ~Getter~
* ~Setter~
* ~Type Aliases~
* Methods
* ~Declaration~
* Use
* Traits
* Generics
* Enums
* Arrays
* Strings
* Lambdas
* Async
* Imports
* Visibility
* Const / Mut