You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was extremely difficult to minimize, and this is as short as I could make it.
In clean compilation we get an implicit not found error, but if we comment out dfVal.as(DFBool) in DFBool.scala the code compiles successfully, and afterwords we can uncomment it and still get a successful compilation.
The compilation order is affected from very little things and there is a special order that causes the implicit not to be found. To get this order various features take place and include export, inline macro, extension methods, and opaque types.
[error] --Error:C:\IdeaProjects\dottybug\src\main\scala\DFBool.scala:6:65---------------------------------------
[error] 6|extension (dfVal: DFVal[DFBool]) defbar:Unit= dfVal.as(DFBool)
[error] |^
[error] | no implicit argument of typeDFType.TC[DFBool] was found for parameter tc of method as.
[error] |Ifound:
[error] |
[error] |DFType.TC.ofDFType[T]
[error] |
[error] |Butgiveninstance ofDFType in objectTC does not matchtypeDFType.TC[DFBool].
[error] one error found
Expectation
No error.
The text was updated successfully, but these errors were encountered:
Is the following another example or something different? With 3.0.1
➜ cs launch scala3-repl
scala>objectFoo:|opaquetypeBar=Int|objectBar:| extension (b: Bar) defflip:Bar=-b
|defapply(x: Int):Bar= x
|// defined object Foo
scala>vala=Foo.Bar(42)
vala:Foo.Bar=42
scala>valb= a.flip
valb:Foo.Bar=-42
scala>valc= b.flip
valc:Foo.Bar=42
scala>vald= c.flip
1|vald= c.flip
|^^^^^^|value flip is not a member of Foo.Bar, but could be made available asan extension method.
||The following importmightfixtheproblem:||importFoo.Bar.flip|
scala>
This was extremely difficult to minimize, and this is as short as I could make it.
In clean compilation we get an implicit not found error, but if we comment out
dfVal.as(DFBool)
inDFBool.scala
the code compiles successfully, and afterwords we can uncomment it and still get a successful compilation.The compilation order is affected from very little things and there is a special order that causes the implicit not to be found. To get this order various features take place and include export, inline macro, extension methods, and opaque types.
Compiler version
3.0.3-RC1-bin-20210716-cc47c56-NIGHTLY
Minimized code
Minimized project at: https://github.com/soronpo/dottybug/tree/inc_implicit_err
DFBool.scala
DFType.scala
DFVal.scala
Width.scala
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: