-
-
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
7 changed files
with
106 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# DO NOT CHANGE LINE NUMBERS BELOW | ||
@noinline foo(x, y) = 1 | ||
@noinline foo(x::Integer, y) = 2 | ||
@noinline foo(x, y::Integer) = 3 | ||
@noinline foo(x::Int, y::Int) = 4 | ||
@noinline foo(x::Number, y) = 5 | ||
# END OF LINE NUMBER SENSITIVITY | ||
|
||
ambigs = Any[[], [3], [2,5], [], [3]] | ||
|
||
mt = methods(foo) | ||
tm = mt.defs | ||
|
||
getline(tm) = tm.func.line - 1 | ||
|
||
while tm != nothing | ||
ln = getline(tm) | ||
atarget = ambigs[ln] | ||
if isempty(atarget) | ||
@test tm.ambig == nothing | ||
else | ||
aln = Int[getline(a) for a in tm.ambig] | ||
@test sort(aln) == atarget | ||
end | ||
tm = tm.next | ||
end | ||
|
||
@test foo("hi", "there") == 1 | ||
@test foo(3.1, 3.2) == 5 | ||
@test foo(3, 4) == 4 | ||
@test_throws ErrorException foo(0x03, 4) | ||
@test_throws ErrorException foo(0x03, 4) # test that not inserted into cache |
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