We should support the code below:
struct MyStorage { ... foo: SingletonStorage<Foo> ... }
struct Foo;
type MyDb = inc_complete::DbHandle<MyStorage>;
#[intermediate(id = 1)]
fn foo(ctx: &incremental::Parse, db: &MyDb) -> i32 {
0
}
But we get an error when doing so:
error: DbHandle must have a generic type parameter for the storage type
--> src/foo/mod.rs:84:45
|
84 | fn foo(ctx: &incremental::Parse, db: &incremental::DbHandle) -> Arc<ParseResult> {
| ^^^^^^^^^^^^^^^^^^^^^
If we name the alias something else we get an error making it look like the macro is looking for an exact name:
error: second parameter must be &DbHandle<StorageType>
--> src/foo/mod.rs:86:45
|
86 | fn foo(ctx: &incremental::Parse, db: &Foo) -> Arc<ParseResult> {
| ^^^
This is overly restrictive and prevents users from using the derive macros in more situations
We should support the code below:
But we get an error when doing so:
If we name the alias something else we get an error making it look like the macro is looking for an exact name:
This is overly restrictive and prevents users from using the derive macros in more situations