-
Notifications
You must be signed in to change notification settings - Fork 1.1k
only 329 errors left #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,7 +241,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
|
||
def elementType = enteringTyper { | ||
val arrayParent = tpe :: tpe.parents collectFirst { | ||
case dotc.core.Types.TypeRef(_, ArrayClass, elem :: Nil) => elem | ||
case dotc.core.Types.TypeRef(_, ctx.definitions.ArrayClass, elem :: Nil) => elem | ||
} | ||
arrayParent getOrElse sys.error(fun.fullName + " : " + (tpe :: tpe.baseTypeSeq.toList).mkString(", ")) | ||
} | ||
|
@@ -353,7 +353,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
case lblDf : LabelDef => genLabelDef(lblDf, expectedType) | ||
|
||
case ValDef(_, nme.THIS, _, _) => | ||
debuglog("skipping trivial assign to _$this: " + tree) | ||
ctx.debuglog("skipping trivial assign to _$this: " + tree) | ||
|
||
case ValDef(_, _, _, rhs) => | ||
val sym = tree.symbol | ||
|
@@ -400,7 +400,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
else { | ||
mnode.visitVarInsn(asm.Opcodes.ALOAD, 0) | ||
generatedType = | ||
if (tree.symbol == ArrayClass) ObjectReference | ||
if (tree.symbol == ctx.definitions.ArrayClass) ObjectReference | ||
else brefType(thisName) // inner class (if any) for claszSymbol already tracked. | ||
} | ||
|
||
|
@@ -412,7 +412,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
val sym = tree.symbol | ||
generatedType = symInfoTK(sym) | ||
val hostClass = findHostClass(qualifier.tpe, sym) | ||
debuglog(s"Host class of $sym with qual $qualifier (${qualifier.tpe}) is $hostClass") | ||
ctx.debuglog(s"Host class of $sym with qual $qualifier (${qualifier.tpe}) is $hostClass") | ||
val qualSafeToElide = treeInfo isQualifierSafeToElide qualifier | ||
|
||
def genLoadQualUnlessElidable(): Unit = { if (!qualSafeToElide) { genLoadQualifier(tree) } } | ||
|
@@ -440,11 +440,12 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
} | ||
|
||
case Literal(value) => | ||
import dotty.tools.dotc.core.Constants._ | ||
if (value.tag != UnitTag) (value.tag, expectedType) match { | ||
case (dotc.core.Constants.IntTag, LONG ) => bc.lconst(value.longValue); generatedType = LONG | ||
case (dotc.core.Constants.FloatTag, DOUBLE) => bc.dconst(value.doubleValue); generatedType = DOUBLE | ||
case (dotc.core.Constants.NullTag, _ ) => bc.emit(asm.Opcodes.ACONST_NULL); generatedType = RT_NULL | ||
case _ => genConstant(value); generatedType = tpeTK(tree) | ||
case (IntTag, LONG ) => bc.lconst(value.longValue); generatedType = LONG | ||
case (FloatTag, DOUBLE) => bc.dconst(value.doubleValue); generatedType = DOUBLE | ||
case (NullTag, _ ) => bc.emit(asm.Opcodes.ACONST_NULL); generatedType = RT_NULL | ||
case _ => genConstant(value); generatedType = tpeTK(tree) | ||
} | ||
|
||
case blck : Block => genBlock(blck, expectedType) | ||
|
@@ -517,7 +518,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
*/ | ||
def genConstant(const: Constant): Unit = { | ||
|
||
import dotc.core.Constants._ | ||
import dotty.tools.dotc.core.Constants._ | ||
|
||
(const.tag: @switch) match { | ||
|
||
|
@@ -587,7 +588,10 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
case nextCleanup :: rest => | ||
if (saveReturnValue) { | ||
if (insideCleanupBlock) { | ||
cunit.warning(r.pos, "Return statement found in finally-clause, discarding its return-value in favor of that of a more deeply nested return.") | ||
ctx.warning( | ||
"Return statement found in finally-clause, discarding its return-value in favor of that of a more deeply nested return.", | ||
core.Decorators.sourcePos(r.pos) | ||
) | ||
bc drop returnType | ||
} else { | ||
// regarding return value, the protocol is: in place of a `return-stmt`, a sequence of `adapt, store, jump` are inserted. | ||
|
@@ -611,11 +615,10 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
case Apply(TypeApply(fun, targs), _) => | ||
|
||
val sym = fun.symbol | ||
val cast = sym match { | ||
case Object_isInstanceOf => false | ||
case Object_asInstanceOf => true | ||
case _ => abort(s"Unexpected type application $fun[sym: ${sym.fullName}] in: $app") | ||
} | ||
val cast = | ||
if (sym == ctx.definitions.Object_isInstanceOf) false | ||
else if (sym == ctx.definitions.Object_asInstanceOf) true | ||
else abort(s"Unexpected type application $fun[sym: ${sym.fullName}] in: $app") | ||
|
||
val Select(obj, _) = fun | ||
val l = tpeTK(obj) | ||
|
@@ -753,7 +756,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
fun match { | ||
case Select(qual, _) => | ||
val qualSym = findHostClass(qual.tpe, sym) | ||
if (qualSym == ArrayClass) { | ||
if (qualSym == ctx.definitions.ArrayClass) { | ||
targetTypeKind = tpeTK(qual) | ||
ctx.log(s"Stored target type kind for ${sym.fullName} as $targetTypeKind") | ||
} | ||
|
@@ -766,7 +769,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
|
||
case _ => | ||
} | ||
if ((targetTypeKind != null) && (sym == definitions.Array_clone) && invokeStyle.isDynamic) { | ||
if ((targetTypeKind != null) && (sym == ctx.definitions.Array_clone) && invokeStyle.isDynamic) { | ||
val target: String = targetTypeKind.getInternalName | ||
bc.invokevirtual(target, "clone", "()Ljava/lang/Object;") | ||
} | ||
|
@@ -910,7 +913,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
} | ||
|
||
/* Generate code that loads args into label parameters. */ | ||
def genLoadLabelArguments(args: List[Tree], lblDef: LabelDef, gotoPos: dotc.util.Positions.Position): Unit = { | ||
def genLoadLabelArguments(args: List[Tree], lblDef: LabelDef, gotoPos: dotty.tools.dotc.util.Positions.Position): Unit = { | ||
|
||
val aps = { | ||
val params: List[Symbol] = lblDef.params.map(_.symbol) | ||
|
@@ -1024,7 +1027,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
def genCallMethod(method: Symbol, | ||
style: InvokeStyle, | ||
hostClass0: Symbol = null, | ||
pos: dotc.util.Positions.Position = dotc.util.Positions.NoPosition) { | ||
pos: dotty.tools.dotc.util.Positions.Position = dotty.tools.dotc.util.Positions.NoPosition) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
val siteSymbol = claszSymbol | ||
val hostSymbol = if (hostClass0 == null) method.owner else hostClass0; | ||
|
@@ -1307,7 +1310,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { | |
|
||
markProgramPoint(lNonNull) | ||
locals.load(eqEqTempLocal) | ||
genCallMethod(Object_equals, icodes.opcodes.Dynamic) | ||
genCallMethod(ctx.definitions.Object_equals, icodes.opcodes.Dynamic) | ||
genCZJUMP(success, failure, icodes.NE, BOOL) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -621,7 +621,7 @@ abstract class BCodeGlue { | |
* | ||
* must-single-thread | ||
*/ | ||
def brefType(iname: String): BType = { brefType(dotc.core.Names.typeName(iname.toCharArray(), 0, iname.length())) } | ||
def brefType(iname: String): BType = { brefType(dotty.tools.dotc.core.Names.typeName(iname.toCharArray(), 0, iname.length())) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
/* | ||
* Creates a BType token for the TypeName received as argument. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,14 +142,14 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { | |
*/ | ||
object isJavaEntryPoint { | ||
|
||
import dotc.core.Types.{MethodType, PolyType} | ||
import dotty.tools.dotc.core.Types.{MethodType, PolyType} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto ( |
||
|
||
/* | ||
* must-single-thread | ||
*/ | ||
def apply(sym: Symbol, csymCompUnit: CompilationUnit): Boolean = { | ||
def fail(msg: String, pos: dotc.util.Positions.Position = sym.pos) = { | ||
csymCompUnit.warning(sym.pos, | ||
def apply(sym: Symbol, ctx: Context): Boolean = { | ||
def fail(msg: String, pos: dotty.tools.dotc.util.Positions.Position = sym.pos) = { | ||
ctx.warning(sym.pos, | ||
sym.name + | ||
s" has a main method with parameter type Array[String], but ${sym.fullName('.')} will not be a runnable program.\n Reason: $msg" | ||
// TODO: make this next claim true, if possible | ||
|
@@ -491,7 +491,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { | |
} | ||
|
||
def primitiveOrRefType(sym: Symbol): BType = { | ||
assert(sym != definitions.ArrayClass, "Use primitiveOrArrayOrRefType() instead.") | ||
assert(sym != ctx.definitions.ArrayClass, "Use primitiveOrArrayOrRefType() instead.") | ||
|
||
primitiveTypeMap.getOrElse(sym, newReference(sym)) | ||
} | ||
|
@@ -512,25 +512,25 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { | |
} | ||
} | ||
|
||
import dotc.core.Types.{ThisType, ConstantType, TypeRef, ClassInfo} | ||
import dotty.tools.dotc.core.Types.{ThisType, ConstantType, TypeRef, ClassInfo} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... |
||
|
||
// Call to .normalize fixes #3003 (follow type aliases). Otherwise, primitiveOrArrayOrRefType() would return ObjectReference. | ||
t match { | ||
|
||
case ThisType(sym) => | ||
if (sym == ArrayClass) ObjectReference | ||
else phantomTypeMap.getOrElse(sym, exemplar(sym).c) | ||
if (sym == ctx.definitions.ArrayClass) ObjectReference | ||
else phantomTypeMap.getOrElse(sym, exemplar(sym).c) | ||
|
||
case SingleType(_, sym) => primitiveOrRefType(sym) | ||
|
||
case _: ConstantType => toTypeKind(t.underlying) | ||
|
||
case TypeRef(_, sym, args) => | ||
if (sym == ArrayClass) arrayOf(toTypeKind(args.head)) | ||
else primitiveOrRefType2(sym) | ||
if (sym == ctx.definitions.ArrayClass) arrayOf(toTypeKind(args.head)) | ||
else primitiveOrRefType2(sym) | ||
|
||
case ClassInfo(_, _, sym) => | ||
assert(sym != ArrayClass, "ClassInfoType to ArrayClass!") | ||
assert(sym != ctx.definitions.ArrayClass, "ClassInfoType to ArrayClass!") | ||
primitiveOrRefType(sym) | ||
|
||
case norm => abort( | ||
|
@@ -667,9 +667,10 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters { | |
(arg: @unchecked) match { | ||
|
||
case LiteralAnnotArg(const) => | ||
import dotty.tools.dotc.core.Constants._ | ||
if (const.isNonUnitAnyVal) { av.visit(name, const.value) } | ||
else { | ||
const.tag match { | ||
(const.tag: @switch) match { | ||
case StringTag => | ||
assert(const.value != null, const) // TODO this invariant isn't documented in `case class Constant` | ||
av.visit(name, const.stringValue) // `stringValue` special-cases null, but that execution path isn't exercised for a const with StringTag | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ object icodes { | |
/** Call through super[mix]. | ||
* On JVM, translated to `invokespecial`. | ||
*/ | ||
case class SuperCall(mix: dotc.core.Names.TermName) extends InvokeStyle { | ||
case class SuperCall(mix: dotty.tools.dotc.core.Names.TermName) extends InvokeStyle { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto. |
||
override def isSuper = true | ||
override def toString(): String = { "super(" + mix + ")" } | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just
util.Positions.Position
should work