import `export`ed function from another file lose default parameters
See original GitHub issueCompiler version
3.1.2
Minimized code
from/E.scala
package from
object E {
def toStr(b: Boolean = true) = {
b.toString
}
}
export E.toStr
main.scala
import from.toStr
@main def exportBug = {
toStr() //missing argument for parameter b of method toStr in package from: (b: Boolean): String
}
Output
compile error: missing argument for parameter b of method toStr in package from: (b: Boolean): String
Missing default parameters may be a compiler bug?
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
Call a function imported from another file - Stack Overflow
1 Answer 1. Sorted by: Reset to default. Highest score (default) ...
Read more >Node.js Modules: Import and use Functions from Another File
To access the module functions, we have to export the functions and import them in the file we want to call the functions....
Read more >Every Thing You Should Know About JavaScript Export
Default exports are useful to export only a single values. During the import, able to ommit the curly bares and use any name....
Read more >export - JavaScript - MDN Web Docs
The export declaration is used to export values from a JavaScript module. Exported values can then be imported into other programs with the ......
Read more >Documentation - Modules - TypeScript
Default exports Each module can optionally export a default export. Default exports are marked with the keyword default ; and there can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we can reopen that as a bug in incremental compilation. It doesn’t work very well with exports.
Probably this issue is related to: https://github.com/lampepfl/dotty/issues/11841 .
Oh, it works with
sbt clean compile
, tks, i’ll close this issue