File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed 
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,17 @@ object Inliner:
119119    override  def  transform (tree : Tree )(using  Context ):  Tree  = 
120120      tree match 
121121      case  Typed (expr, tpt) => 
122-         tpt.tpe match 
123-         case  AnnotatedType (_, annot) if  annot.hasSymbol(defn.NowarnAnnot ) => 
124-           val  argPos  =  annot.argument(0 ).getOrElse(tree).sourcePos
125-           val  conf  =  annot.argumentConstantString(0 ).getOrElse(" "  )
126-           ctx.run.nn.suppressions.registerNowarn(tree.sourcePos, expr.span)(conf, argPos)
127-         case  _ => 
122+         def  loop (tpe : Type ):  Unit  = 
123+           tpe match 
124+           case  AnnotatedType (parent, annot) => 
125+             if  annot.hasSymbol(defn.NowarnAnnot ) then 
126+               val  argPos  =  annot.argument(0 ).getOrElse(tree).sourcePos
127+               val  conf  =  annot.argumentConstantString(0 ).getOrElse(" "  )
128+               ctx.run.nn.suppressions.registerNowarn(tree.sourcePos, expr.span)(conf, argPos)
129+             else 
130+               loop(parent)
131+           case  _ => 
132+         loop(tpt.tpe)
128133      case  _ => 
129134      super .transform(tree)
130135
Original file line number Diff line number Diff line change 11
22package  p 
33
4- import  annotation .* 
4+ import  annotation .{ unchecked   as   _ ,  * } 
55
66@ deprecated(" old api"  , since= " 1.0"  )
77def  g  =  42 
@@ -12,4 +12,5 @@ inline def f =
1212  g
1313
1414transparent  inline  def  body  = 
15-   g : @ nowarn
15+   g : @ nowarn @ unchecked
16+   g : @ unchecked @ nowarn
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments