Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/query-group-macro/tests/supertrait.rs')
-rw-r--r--crates/query-group-macro/tests/supertrait.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/query-group-macro/tests/supertrait.rs b/crates/query-group-macro/tests/supertrait.rs
new file mode 100644
index 0000000000..70073ac1de
--- /dev/null
+++ b/crates/query-group-macro/tests/supertrait.rs
@@ -0,0 +1,20 @@
+use query_group_macro::query_group;
+
+#[salsa::db]
+pub trait SourceDb: salsa::Database {
+ /// Text of the file.
+ fn file_text(&self, id: usize) -> String;
+}
+
+#[query_group]
+pub trait RootDb: SourceDb {
+ #[salsa::invoke_interned(parse)]
+ fn parse(&self, id: usize) -> String;
+}
+
+fn parse(db: &dyn RootDb, id: usize) -> String {
+ // this is the test: does the following compile?
+ db.file_text(id);
+
+ String::new()
+}