Merge "Make sure nullability in type lattice conforms to neverNull bit."
diff --git a/src/main/java/com/android/tools/r8/ir/code/IRCode.java b/src/main/java/com/android/tools/r8/ir/code/IRCode.java
index bef2765..a5070ca 100644
--- a/src/main/java/com/android/tools/r8/ir/code/IRCode.java
+++ b/src/main/java/com/android/tools/r8/ir/code/IRCode.java
@@ -686,6 +686,9 @@
   public boolean verifyNoImpreciseOrBottomTypes() {
     Predicate<Value> verifyValue =
         v -> {
+          assert !v.isNeverNull()
+              || (v.getTypeLattice().isReference()
+                  && v.getTypeLattice().nullability().isDefinitelyNotNull());
           assert v.getTypeLattice().isPreciseType();
           assert !v.getTypeLattice().isFineGrainedType();
           // For now we assume no bottom types on IR values. We may want to reconsider this for