Title: How to use custom predef for all files in project
Tags: scala;import
Question: I'd like to shadow some Predef members and introduce my own realization for them. How can I inform compiler that my.own.Predef._ should be imported instead of scala.Predef._ ?


Here is another answer: One way I've seen this done is through chained package clauses.
If the file at my/own/package.scala has, for example:
package my
package object own {
type ISeq[+A] = IndexedSeq[A]
val ISeq = IndexedSeq
Then any file in the package my.own or a subpackage of my.own will automatically import ISeq as if it came from Predef, IF you change your package declaration at the top of the file from
package my.own.foo
package my.own
package foo
The latter form is called a chained package clause.
This article (which uses chained package to change Seq to use the immutable interface) seems to indicate that you can shadow members in scala.Predef this way.
Comment for this answer: Unfortunately, you need to update the package line of every file to use this, moving to package chaining which isn't a best practice, so you might as well just add the import for `immutable.Seq`.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2015:00:09/25/15', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<scala><import>', 'Title': 'How to use custom predef for all files in project', 'ViewCount': 373, 'id': 32788610, 'user_AboutMe': '', 'user_AccountId': 444988.0, 'user_DisplayName': 'ayvango', 'user_Reputation': 5787.0, 'user_Views': 368.0, 'user_id': 837133.0}}