-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: infer associate functions (#575)
- Loading branch information
1 parent
6537d40
commit 0acea1c
Showing
5 changed files
with
134 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
crates/mun_hir/src/ty/snapshots/mun_hir__ty__tests__infer_access_hidden_assoc_function.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: crates/mun_hir/src/ty/tests.rs | ||
expression: "infer(r#\"\n //- /foo.mun\n pub struct Foo {\n a: i32\n }\n\n impl Foo {\n fn new(){}\n }\n\n //- /mod.mun\n fn main() {\n foo::Foo::new();\n }\n \"#)" | ||
--- | ||
16..29: access of private type | ||
10..34 '{ ...w(); }': () | ||
16..29 'foo::Foo::new': function new() -> () | ||
16..31 'foo::Foo::new()': () | ||
54..56 '{}': () |
11 changes: 11 additions & 0 deletions
11
crates/mun_hir/src/ty/snapshots/mun_hir__ty__tests__infer_assoc_function.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
source: crates/mun_hir/src/ty/tests.rs | ||
expression: "infer(r#\"\n struct Foo {\n a: i32\n }\n\n impl Foo {\n fn new() -> Self {\n Self { a: 3 }\n }\n }\n\n fn main() {\n let a = Foo::new();\n }\n \"#)" | ||
--- | ||
102..129 '{ ...w(); }': () | ||
112..113 'a': Foo | ||
116..124 'Foo::new': function new() -> Foo | ||
116..126 'Foo::new()': Foo | ||
59..88 '{ ... }': Foo | ||
69..82 'Self { a: 3 }': Foo | ||
79..80 '3': i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters