- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
Record failures to adapt application arguments #18269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            2 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| -- [E007] Type Mismatch Error: tests/neg-macros/i16522.scala:10:45 ----------------------------------------------------- | ||
| 10 | case '{HCons($h1: hd1, HCons($h2: hd2, $_ : tl))} => '{$h1.toString ++ $h2.toString} // error | ||
| 10 | case '{HCons($h1: hd1, HCons($h2: hd2, $_ : tl))} => '{$h1.toString ++ $h2.toString} // error // error // error | ||
| | ^^^^^^^ | ||
| | Found: tl | ||
| | Required: HList | ||
| | | ||
| | longer explanation available when compiling with `-explain` | ||
| -- [E006] Not Found Error: tests/neg-macros/i16522.scala:10:62 --------------------------------------------------------- | ||
| 10 | case '{HCons($h1: hd1, HCons($h2: hd2, $_ : tl))} => '{$h1.toString ++ $h2.toString} // error // error // error | ||
| | ^^ | ||
| | Not found: h1 | ||
| | | ||
| | longer explanation available when compiling with `-explain` | ||
| -- [E006] Not Found Error: tests/neg-macros/i16522.scala:10:78 --------------------------------------------------------- | ||
| 10 | case '{HCons($h1: hd1, HCons($h2: hd2, $_ : tl))} => '{$h1.toString ++ $h2.toString} // error // error // error | ||
| | ^^ | ||
| | Not found: h2 | ||
| | | ||
| | longer explanation available when compiling with `-explain` | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -58,5 +58,5 @@ object Test2: | |
| def foo5(x: Int) = | ||
| foo2(foo2(,) // error // error | ||
| 
     | 
||
| println(bam) // error | ||
| println(bam) | ||
| // error | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import scala.language.implicitConversions | ||
| 
     | 
||
| // We do have 2 `contramap` functions, one provided via `LoggerSyntax` other via `Contravariant.Ops` | ||
| // `ContravariantMonoidal` given instances are not used, and they do not match our type. Code fails when we have at least 2 instances of them | ||
| // Removal of `import catsSyntax._` allow to compile code | ||
| // Removal of `import odinSyntax.LoggerSyntax` and remaining `catsSyntax` would fail to compile the `def fails` | ||
| 
     | 
||
| trait Foo[A] | ||
| trait Bar[A] | ||
| 
     | 
||
| trait WriterT[F[_]: Contravariant, L, V]: | ||
| def contramap[Z](fn: Z => V): WriterT[F, L, Z] = ??? | ||
| trait Logger[F[_]] | ||
| class WriterTLogger[F[_]] extends Logger[[G] =>> WriterT[F, List[String], G]] | ||
| 
     | 
||
| trait ContravariantMonoidal[F[_]] extends Invariant[F] with Contravariant[F] | ||
| trait Invariant[F[_]] | ||
| object Invariant: | ||
| given ContravariantMonoidal[Foo] = ??? | ||
| given ContravariantMonoidal[Bar] = ??? | ||
| 
     | 
||
| trait Contravariant[F[_]] extends Invariant[F] | ||
| object Contravariant: | ||
| trait Ops[F[_], A]: | ||
| def contramap[B](f: B => A): F[B] = ??? | ||
| 
     | 
||
| object catsSyntax: | ||
| implicit def toContravariantOps[F[_]: Contravariant, A](target: F[A]): Contravariant.Ops[F, A] = ??? | ||
| 
     | 
||
| object odinSyntax: | ||
| implicit class LoggerSyntax[F[_]](logger: Logger[F]): | ||
| def contramap(f: String => String): Logger[F] = ??? | ||
| 
     | 
||
| import catsSyntax._ | ||
| import odinSyntax.LoggerSyntax | ||
| 
     | 
||
| class Test: | ||
| def fails = new WriterTLogger[Option].contramap(identity) | ||
| def works = LoggerSyntax(new WriterTLogger[Option]).contramap(identity) | ||
| 
     | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import scala.language.implicitConversions | ||
| 
     | 
||
| trait Foo[A] | ||
| trait Bar[B] | ||
| trait Qux[C] | ||
| class Log[K[_]] | ||
| 
     | 
||
| trait Inv[F[_]] | ||
| object Inv: | ||
| given monFoo: Inv[Foo] = ??? | ||
| given monBar: Inv[Bar] = ??? | ||
| 
     | 
||
| trait InvOps[H[_], D] { def desc(s: String): H[D] = ??? } | ||
| trait LogOps[L[_]] { def desc(s: String): Log[L] = ??? } | ||
| 
     | 
||
| class Test: | ||
| implicit def LogOps[Q[_]](l: Log[Q]): LogOps[Q] = ??? | ||
| implicit def InvOps[J[_], E](j11: J[E])(implicit z: Inv[J]): InvOps[J, E] = ??? | ||
| 
     | 
||
| def fails = new Log[Qux].desc("fails") | ||
| def works = LogOps[Qux](new Log[Qux]).desc("works") | 
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, why the change to the test here? Could you possibly ping me or anyone from the Metals team next time something within the presentation compiler needs to change? That would be greatly appreciated 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. It's because otherwise
doubledoesn't typecheck, becauseString * Anydoesn't typecheck.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ach, right! Makes sense!