Expand inference.

This commit is contained in:
Christoffer Lerno
2026-01-17 14:03:58 +01:00
parent 70c4b24519
commit c2e603ddd8
11 changed files with 248 additions and 175 deletions

View File

@@ -0,0 +1,14 @@
import std;
struct Result @generic(WithType2)
{
fault error;
}
macro err(fault error) @generic(OfType, SOME_CONST) @builtin => (Result{OfType}){ .error = error };
faultdef TESTIN;
fn int main()
{
Result{int} x = err(TESTIN); // #error: Found 'err' in the module 'generic_infer_mismatch', but it lacks parameters
return 0;
}

View File

@@ -0,0 +1,14 @@
import std;
struct Result @generic(WithType2)
{
fault error;
}
macro err(fault error) @generic(OfType) @builtin => (Result{OfType}){ .error = error };
faultdef TESTIN;
fn int main()
{
Result{int} x = err(TESTIN);
return 0;
}