-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
168 additions
and
13 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Test | ||
|
||
macro placeholder(sym) | ||
:(const $(esc(sym)) = $(Expr(:new, Core.Placeholder, :(Any[])))) | ||
end | ||
|
||
@placeholder Bar1 | ||
struct Foo1 | ||
x::Bar1 | ||
end | ||
@test length(methods(Foo1)) == 0 | ||
@test Foo1.incomplete | ||
struct Bar1 | ||
x::Foo1 | ||
end | ||
@test length(methods(Bar1)) == 2 | ||
@test length(methods(Foo1)) == 2 | ||
|
||
|
||
@placeholder Bar2 | ||
@placeholder Baz2 | ||
struct Foo2 | ||
x::Bar2 | ||
y::Baz2 | ||
end | ||
@test Foo2.incomplete | ||
struct Bar2 | ||
x::Foo2 | ||
end | ||
@test length(methods(Bar2)) == 0 | ||
@test Bar2.incomplete | ||
struct Baz2; end | ||
@test !Foo2.incomplete && !Bar2.incomplete |