Buggy code:
public final class TypePropagation { private final ModuleLoader loader ; private final Resolver resolver ; private ArrayList < TypePropagation . Scope > scopes = new ArrayList < TypePropagation . Scope > ( ) ; private String filename ; private FunctionOrMethodOrMessage current ; public TypePropagation ( ModuleLoader loader , Resolver resolver ) { } public void propagate ( WhileyFile wf ) { } public void propagate ( Constant cd , WhileyFile wf , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } public void propagate ( TypeDef td , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } public void propagate ( FunctionOrMethodOrMessage d , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } private RefCountedHashMap < String , Nominal > propagate ( ArrayList < Stmt > body , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Assert stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Assign stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private AssignedVariable inferAfterType ( Expr . LVal lv , Nominal afterType ) { if ( lv instanceof Expr . AssignedVariable ) { Expr . AssignedVariable v = ( ( Expr . AssignedVariable ) ( lv ) ) ; v . afterType = afterType ; return v ; } else if ( lv instanceof Expr . Dereference ) { Expr . Dereference pa = ( ( Expr . Dereference ) ( lv ) ) ; <START_BUG> checkIsSubtype ( pa . srcType , afterType , lv ) ; <END_BUG> return inferAfterType ( ( ( Expr . LVal ) ( pa . src ) ) , pa . srcType ) ; } else if ( lv instanceof Expr . StringAccess ) { Expr . StringAccess la = ( ( Expr . StringAccess ) ( lv ) ) ; return inferAfterType ( ( ( Expr . LVal ) ( la . src ) ) , T_STRING ) ; } else if ( lv instanceof Expr . ListAccess ) { Expr . ListAccess la = ( ( Expr . ListAccess ) ( lv ) ) ; afterType = Nominal . List ( Nominal . Union ( la . result ( ) , afterType ) , false ) ; return inferAfterType ( ( ( Expr . LVal ) ( la . src ) ) , afterType ) ; } else if ( lv instanceof Expr . DictionaryAccess ) { Expr . DictionaryAccess da = ( ( Expr . DictionaryAccess ) ( lv ) ) ; Nominal . Dictionary srcType = da . srcType ; afterType = Nominal . Dictionary ( Nominal . Union ( srcType . key ( ) , da . index . result ( ) ) , Nominal . Union ( srcType . value ( ) , afterType ) ) ; return inferAfterType ( ( ( Expr . LVal ) ( da . src ) ) , afterType ) ; } else if ( lv instanceof Expr . RecordAccess ) { Expr . RecordAccess la = ( ( Expr . RecordAccess ) ( lv ) ) ; Nominal . Record srcType = la . srcType ; HashMap < String , Nominal > afterFields = srcType . fields ( ) ; afterFields . put ( la . name , afterType ) ; afterType = Nominal . Record ( srcType . isOpen ( ) , afterFields ) ; System . out . println ( ( "AFTER<seq2seq4repair_space>TYPE:<seq2seq4repair_space>" + afterType ) ) ; return inferAfterType ( ( ( Expr . LVal ) ( la . src ) ) , afterType ) ; } else { internalFailure ( ( "unknown<seq2seq4repair_space>lval:<seq2seq4repair_space>" + ( lv . getClass ( ) . getName ( ) ) ) , filename , lv ) ; return null ; } } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Break stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Debug stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . DoWhile stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . ForAll stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . IfElse stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Return stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Skip stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Switch stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) throws ResolveError { } private RefCountedHashMap < String , Nominal > propagate ( Stmt . Throw stmt , RefCountedHashMap < String , Nominal > environment , ArrayList < WhileyFile . Import > imports ) { }

Fix:
checkIsSubtype ( pa . srcType , Nominal . Reference ( afterType ) , lv ) ;