-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to use private default method from a trait
This commit fixes type checking of class that implement a trait which contains a private method with a default implementation. Previously the usage of such method resulted in an error during type checking saying that the method is private. This fixes #605. Changelog: fixed
- Loading branch information
1 parent
94a8b63
commit aa615ed
Showing
4 changed files
with
21 additions
and
3 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
11 changes: 11 additions & 0 deletions
11
std/test/diagnostics/class_with_trait_with_default_method.inko
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 @@ | ||
import foo.Foo | ||
|
||
class Bar { | ||
fn baz {} | ||
} | ||
|
||
impl Foo for Bar {} | ||
|
||
fn example(value: Bar) { | ||
value.foo | ||
} |
5 changes: 5 additions & 0 deletions
5
std/test/diagnostics/class_with_trait_with_default_method/foo.inko
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,5 @@ | ||
trait pub Foo { | ||
fn foo { | ||
42 | ||
} | ||
} |
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