Skip to content

Commit

Permalink
Add test case from typetools#3550.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Aug 4, 2020
1 parent d0eaf34 commit 48ea6d0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions framework/tests/nontopdefault/TestCasting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import testlib.nontopdefault.qual.NTDMiddle;

@SuppressWarnings("inconsistent.constructor.type") // Not the point of this test
public class TestCasting {
void repro(@NTDMiddle long startTime) {
try {
System.out.println("Inside try");
return;
} catch (Exception ex) {
long timeTaken = startTime;
@NTDMiddle double dblTimeTaken = timeTaken;

throw new IllegalArgumentException();
} finally {
long timeTaken2 = startTime;
// This assignment used to fail.
@NTDMiddle double dblTimeTaken2 = timeTaken2;
}
}
}

0 comments on commit 48ea6d0

Please sign in to comment.