DenialAdams / roland

Roland programming language
https://www.brick.codes/roland
Apache License 2.0
46 stars 0 forks source link

Pattern match expressions when we know the declared type to avoid creating new type variables when possible #91

Closed DenialAdams closed 1 year ago

DenialAdams commented 1 year ago
extern proc foo(x: u8);

let x: u8 = 123;
foo(123);

In these cases, the type inference is obvious and doesn't require creating a type variable. Creating a type variable involves updating at least two hash maps and so is pretty damn slow.

We might also want to pattern match -. (or maybe that should have already been pattern matched ahead of time? I kind of want to remove synthetic)

DenialAdams commented 1 year ago

Creating a type variable involves updating at least two hash maps and so is pretty damn slow.

This is no longer true

Closing this because I don't really feel like doing it, I may come back to it