Import aliases(imports are confusing things about some libraries)


#1

If I understand correctly, there is no planning to improve such situation. There will be no receiver functions or scope injection. May be, it is possible to do «Import aliases»

trait SomeTrait{
imports html = {
    import _root_.part1.part2.html._
    import  _root_.part1.template._
}
def html(given Html=>):Html = ???
}
object Main extends SomeTrait{
def main()=Unit 
    Html{
         header{}
         body{}
    }
}
}

Unfortunately, now, the Scala imports is occasionally a headache.

see also:


#2

Looks like yet one reincarnation of ‘@exported imports’.
(proposal with implementation: https://docs.google.com/document/d/1dlT6NgB9610jqLscCJW2LRB7TapDh3q4d2S3YA_q5zs/edit
Last discussion here: Pre-SIP: export, dual* of import
)
// about further progress/development, I think it is possible to revive this proposal (i.e. submit this PRE-SIP) if we will know, that exists enough interest for such feature within community and compiler maintainers.