bug in typescript compilation