Skip to content

Commit

Permalink
Fix build failure after merging scala#1492
Browse files Browse the repository at this point in the history
The one-parameter constructor of SourceFile was removed in scala#1494
  • Loading branch information
smarter committed Oct 6, 2016
1 parent 87a7757 commit cee862c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import util.{Property, SourceFile, NoSource}
import typer.ErrorReporting._

import scala.annotation.tailrec
import scala.io.Codec

/** Some creators for typed trees */
object tpd extends Trees.Instance[Type] with TypedTreeInfo {
Expand Down Expand Up @@ -940,7 +941,8 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
*/
def sourceFile(call: Tree)(implicit ctx: Context) = {
val file = call.symbol.sourceFile
if (file != null && file.exists) new SourceFile(file) else NoSource
val encoding = ctx.settings.encoding.value
if (file != null && file.exists) new SourceFile(file, Codec(encoding)) else NoSource
}
}

0 comments on commit cee862c

Please sign in to comment.