From d9c8ccce14bdd4f9364af4941cd47edbfec0c8ce Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 23 May 2013 21:23:25 +0200 Subject: SI-7509 Avoid crasher as erronous args flow through NamesDefaults The fix for SI-7238 caused this regression. This commit marks taints whole Apply with an ErrorType if it has an erroneous argument, so as to stop a later crash trying to further process the tree. --- src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index f3736f1519..802df39f01 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -333,9 +333,12 @@ trait NamesDefaults { self: Analyzer => // type the application without names; put the arguments in definition-site order val typedApp = doTypedApply(tree, funOnly, reorderArgs(namelessArgs, argPos), mode, pt) typedApp match { - // Extract the typed arguments, restore the call-site evaluation order (using - // ValDef's in the block), change the arguments to these local values. - case Apply(expr, typedArgs) if !(typedApp :: typedArgs).exists(_.isErrorTyped) => // bail out with erroneous args, see SI-7238 + case Apply(expr, typedArgs) if (typedApp :: typedArgs).exists(_.isErrorTyped) => + setError(tree) // bail out with and erroneous Apply *or* erroneous arguments, see SI-7238, SI-7509 + case Apply(expr, typedArgs) => + // Extract the typed arguments, restore the call-site evaluation order (using + // ValDef's in the block), change the arguments to these local values. + // typedArgs: definition-site order val formals = formalTypes(expr.tpe.paramTypes, typedArgs.length, removeByName = false, removeRepeated = false) // valDefs: call-site order -- cgit v1.2.3 From de12ca6ef8071820c6b2a9403ccab9aa6ed51c0b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 23 May 2013 16:50:45 -0700 Subject: SI-7486 Regressions in implicit search. Revert e86832d7e8 and dd33e280e2. --- .../scala/tools/nsc/typechecker/Implicits.scala | 17 +++-------------- test/files/neg/t7441.check | 6 ------ test/files/neg/t7441.scala | 7 ------- test/files/pos/t7486.scala | 8 -------- test/pending/neg/t7441.check | 6 ++++++ test/pending/neg/t7441.scala | 7 +++++++ test/pending/pos/t7486.scala | 8 ++++++++ 7 files changed, 24 insertions(+), 35 deletions(-) delete mode 100644 test/files/neg/t7441.check delete mode 100644 test/files/neg/t7441.scala delete mode 100644 test/files/pos/t7486.scala create mode 100644 test/pending/neg/t7441.check create mode 100644 test/pending/neg/t7441.scala create mode 100644 test/pending/pos/t7486.scala (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index ef87a32c1d..35a4461ccc 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -997,22 +997,11 @@ trait Implicits { if (settings.Xdivergence211.value) DivergingImplicitExpansionError(tree, pt, DivergentImplicitRecovery.sym)(context) else throw DivergentImplicit } - else if (invalidImplicits.nonEmpty) { - val sym = invalidImplicits.head - // We don't even dare look if errors are being buffered - // !sym.hasFlag(LOCKED) is a hail mary between SI-2206 and SI-7486 - def isSensibleAddendum = !sym.hasFlag(LOCKED) && (pt match { - case Function1(_, out) => out <:< sym.tpe.finalResultType - case _ => pt <:< sym.tpe.finalResultType - }) - // Don't pitch in with this theory unless it looks plausible that the - // implicit would have helped + + if (invalidImplicits.nonEmpty) setAddendum(pos, () => - if (isSensibleAddendum) - s"\n Note: implicit $sym is not applicable here because it comes after the application point and it lacks an explicit result type" - else "" + s"\n Note: implicit ${invalidImplicits.head} is not applicable here because it comes after the application point and it lacks an explicit result type" ) - } } best diff --git a/test/files/neg/t7441.check b/test/files/neg/t7441.check deleted file mode 100644 index f259457197..0000000000 --- a/test/files/neg/t7441.check +++ /dev/null @@ -1,6 +0,0 @@ -t7441.scala:4: error: type mismatch; - found : Int(1) - required: List[Any] - def test = apply(1) - ^ -one error found diff --git a/test/files/neg/t7441.scala b/test/files/neg/t7441.scala deleted file mode 100644 index dad7421e3f..0000000000 --- a/test/files/neg/t7441.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - object Bar { - def apply(xs: List[Any]): Int = 0 - def test = apply(1) - } - implicit def foo = 1 -} diff --git a/test/files/pos/t7486.scala b/test/files/pos/t7486.scala deleted file mode 100644 index 6dd7f4c4ac..0000000000 --- a/test/files/pos/t7486.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test{ - var locker = 0 - // remove implicit, or change to `locker = locker + 1` to make it compile. - implicit val davyJones0 = { - locker += 0 - 0 - } -} diff --git a/test/pending/neg/t7441.check b/test/pending/neg/t7441.check new file mode 100644 index 0000000000..f259457197 --- /dev/null +++ b/test/pending/neg/t7441.check @@ -0,0 +1,6 @@ +t7441.scala:4: error: type mismatch; + found : Int(1) + required: List[Any] + def test = apply(1) + ^ +one error found diff --git a/test/pending/neg/t7441.scala b/test/pending/neg/t7441.scala new file mode 100644 index 0000000000..dad7421e3f --- /dev/null +++ b/test/pending/neg/t7441.scala @@ -0,0 +1,7 @@ +object Test { + object Bar { + def apply(xs: List[Any]): Int = 0 + def test = apply(1) + } + implicit def foo = 1 +} diff --git a/test/pending/pos/t7486.scala b/test/pending/pos/t7486.scala new file mode 100644 index 0000000000..6dd7f4c4ac --- /dev/null +++ b/test/pending/pos/t7486.scala @@ -0,0 +1,8 @@ +object Test{ + var locker = 0 + // remove implicit, or change to `locker = locker + 1` to make it compile. + implicit val davyJones0 = { + locker += 0 + 0 + } +} -- cgit v1.2.3 From 851e39991e7a929e1d83d5e35a024d5b9bd0b75f Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 27 May 2013 13:36:48 +0200 Subject: SI-7516 Revert "SI-7234 Make named args play nice w. depmet types" This reverts commit 83c9c764b528a7a1c1d39c480d22c8e3a71d5a58. The tests are shunted to 'pending'. Why revert this seemingly innocous commit? 83c9c764 generates a ValDef whose tpt TypeTree has no original; this contains a reference to the symbol for `d`. resetAttrs and the retypecheck assigns a new symbol for d and leaves a the reference to the prior symbol dangling. The real bug is the resetAttrs concept. --- .../scala/tools/nsc/typechecker/NamesDefaults.scala | 12 +++++++----- test/files/pos/t7234.scala | 15 --------------- test/files/pos/t7234b.scala | 20 -------------------- test/files/pos/t7516/A_1.scala | 9 +++++++++ test/files/pos/t7516/B_2.scala | 4 ++++ test/pending/pos/t7234.scala | 15 +++++++++++++++ test/pending/pos/t7234b.scala | 20 ++++++++++++++++++++ 7 files changed, 55 insertions(+), 40 deletions(-) delete mode 100644 test/files/pos/t7234.scala delete mode 100644 test/files/pos/t7234b.scala create mode 100644 test/files/pos/t7516/A_1.scala create mode 100644 test/files/pos/t7516/B_2.scala create mode 100644 test/pending/pos/t7234.scala create mode 100644 test/pending/pos/t7234b.scala (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala index 802df39f01..d54f894c62 100644 --- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala +++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala @@ -284,11 +284,13 @@ trait NamesDefaults { self: Analyzer => case Typed(expr, Ident(tpnme.WILDCARD_STAR)) => expr.tpe case _ => seqType(arg.tpe) } - else - // Note stabilizing can lead to a non-conformant argument when existentials are involved, e.g. neg/t3507-old.scala, hence the filter. - // We have to deconst or types inferred from literal arguments will be Constant(_), e.g. pos/z1730.scala. - gen.stableTypeFor(arg).filter(_ <:< paramTpe).getOrElse(arg.tpe).deconst - ) + else { + // TODO In 83c9c764b, we tried to a stable type here to fix SI-7234. But the resulting TypeTree over a + // singleton type without an original TypeTree fails to retypecheck after a resetLocalAttrs (SI-7516), + // which is important for (at least) macros. + arg.tpe + } + ).widen // have to widen or types inferred from literal defaults will be singletons val s = context.owner.newValue(unit.freshTermName("x$"), arg.pos) setInfo ( if (byName) functionType(Nil, argTpe) else argTpe ) diff --git a/test/files/pos/t7234.scala b/test/files/pos/t7234.scala deleted file mode 100644 index 59a233d835..0000000000 --- a/test/files/pos/t7234.scala +++ /dev/null @@ -1,15 +0,0 @@ -trait Main { - trait A { - type B - } - trait C { - def c(a: A, x: Int = 0)(b: a.B) - } - def c: C - def d(a: A, x: Int = 0)(b: a.B) - - def ok1(a: A)(b: a.B) = c.c(a, 42)(b) - def ok2(a: A)(b: a.B) = d(a)(b) - - def fail(a: A)(b: a.B) = c.c(a)(b) -} diff --git a/test/files/pos/t7234b.scala b/test/files/pos/t7234b.scala deleted file mode 100644 index fee98e87a8..0000000000 --- a/test/files/pos/t7234b.scala +++ /dev/null @@ -1,20 +0,0 @@ -trait Main { - trait A { - type B - def b: B - } - trait C { - def c(a: A, x: Int = 0)(b: => a.B, bs: a.B*) - def d(a: A = null, x: Int = 0)(b1: => a.B = a.b, b2: a.B = a.b) - } - def c: C - def ok(a: A)(b: a.B) = c.c(a, 42)(b) - def fail(a: A)(b: a.B) = c.c(a)(b) - def fail2(a: A)(b: a.B) = c.c(a)(b, b) - def fail3(a: A)(b: a.B) = c.c(a)(b, Seq[a.B](b): _*) - - def fail4(a: A)(b: a.B) = c.d(a)() - def fail5(a: A)(b: a.B) = c.d(a)(b1 = a.b) - def fail6(a: A)(b: a.B) = c.d(a)(b2 = a.b) - def fail7(a: A)(b: a.B) = c.d()() -} diff --git a/test/files/pos/t7516/A_1.scala b/test/files/pos/t7516/A_1.scala new file mode 100644 index 0000000000..3bba19966d --- /dev/null +++ b/test/files/pos/t7516/A_1.scala @@ -0,0 +1,9 @@ +import scala.reflect._,macros._, scala.language.experimental.macros + +object A { + def impl[T: c.WeakTypeTag](c: Context)(t: c.Expr[T]): c.Expr[List[T]] = { + val r = c.universe.reify { List(t.splice) } + c.Expr[List[T]]( c.resetLocalAttrs(r.tree) ) + } + def demo[T](t: T): List[T] = macro impl[T] +} diff --git a/test/files/pos/t7516/B_2.scala b/test/files/pos/t7516/B_2.scala new file mode 100644 index 0000000000..1b8531bc85 --- /dev/null +++ b/test/files/pos/t7516/B_2.scala @@ -0,0 +1,4 @@ +object B { + final case class CV(p: Int = 3, g: Int = 2) + A.demo { val d = 4; CV(g = d); "a" } +} diff --git a/test/pending/pos/t7234.scala b/test/pending/pos/t7234.scala new file mode 100644 index 0000000000..59a233d835 --- /dev/null +++ b/test/pending/pos/t7234.scala @@ -0,0 +1,15 @@ +trait Main { + trait A { + type B + } + trait C { + def c(a: A, x: Int = 0)(b: a.B) + } + def c: C + def d(a: A, x: Int = 0)(b: a.B) + + def ok1(a: A)(b: a.B) = c.c(a, 42)(b) + def ok2(a: A)(b: a.B) = d(a)(b) + + def fail(a: A)(b: a.B) = c.c(a)(b) +} diff --git a/test/pending/pos/t7234b.scala b/test/pending/pos/t7234b.scala new file mode 100644 index 0000000000..fee98e87a8 --- /dev/null +++ b/test/pending/pos/t7234b.scala @@ -0,0 +1,20 @@ +trait Main { + trait A { + type B + def b: B + } + trait C { + def c(a: A, x: Int = 0)(b: => a.B, bs: a.B*) + def d(a: A = null, x: Int = 0)(b1: => a.B = a.b, b2: a.B = a.b) + } + def c: C + def ok(a: A)(b: a.B) = c.c(a, 42)(b) + def fail(a: A)(b: a.B) = c.c(a)(b) + def fail2(a: A)(b: a.B) = c.c(a)(b, b) + def fail3(a: A)(b: a.B) = c.c(a)(b, Seq[a.B](b): _*) + + def fail4(a: A)(b: a.B) = c.d(a)() + def fail5(a: A)(b: a.B) = c.d(a)(b1 = a.b) + def fail6(a: A)(b: a.B) = c.d(a)(b2 = a.b) + def fail7(a: A)(b: a.B) = c.d()() +} -- cgit v1.2.3 From 403eadd0f10cf6e493b81913148b0b9065e80699 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 29 May 2013 23:44:21 +0200 Subject: SI-7517 Fix higher kinded type inference regression - Discovered in 2.10.2-RC1 - Ostensibly regressed in 7e52fb910b, which conceptually reverted part of 0cde930b so that (mutable) TypeVars don't use structural equality. - But, does *not* fail if 7e52fb910b is cherry-picked directly after 0cde930b, suggesting that it shone a light on a behaviour change in some other commit in between the two. - Indeed, the true regression came in https://github.com/scala/scala/commit/e5da30b843#L5L3176 - A targeted revert of e5da30b843 is undesirable, as we'd like SI-6846 to stay fixed What's happening here? In the enclosed test case, higher kinded type inference explores two possibilities: Composed.this.Split[A] K[[T]A[B[T]]] // `Split[A]` dealiased The difference in the flow of type inference can be seen from the diff below. Notice how now we no longer register `?K.addBound(Composed.this.Split)`, we instead only register `?K.addBound(K)` ```patch --- sandbox/old.log 2013-05-30 00:27:34.000000000 +0200 +++ sandbox/new.log 2013-05-30 00:28:28.000000000 +0200 @@ -1,55 +1,114 @@ ?K.unifyFull(Composed.this.Split[A]) ?K.unifySpecific(Composed.this.Split[A]) - ?K.addBound(Composed.this.Split) ?B.unifyFull(T) ?B.unifySpecific(T) `-> false ?B.unifyFull(Any) ?B.unifySpecific(Any) `-> false `-> false ?K.unifySpecific(L[[T]A[B[T]]]) - ?K.addBound(L) ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true + ?K.addBound(L) `-> true ?K.unifyFull(Composed.this.Split[A]) ?K.unifySpecific(Composed.this.Split[A]) - ?K.addBound(Composed.this.Split) ?B.unifyFull(x) ?B.unifySpecific(x) `-> false `-> false ?K.unifySpecific(L[[T]A[B[T]]]) + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true ?K.addBound(L) + `-> true +?K.unifyFull(Composed.this.Split[A]) + ?K.unifySpecific(Composed.this.Split[A]) + ?B.unifyFull(T) + ?B.unifySpecific(T) + `-> false + ?B.unifyFull(Any) + ?B.unifySpecific(Any) + `-> false + `-> false + ?K.unifySpecific(L[[T]A[B[T]]]) ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true ?B.unifyFull(B[T]) ?B.unifySpecific(B[T]) ?B.addBound(B) `-> true + ?K.addBound(L) + `-> true +?K.unifyFull(Composed.this.Split[A]) + ?K.unifySpecific(Composed.this.Split[A]) + ?B.unifyFull(x) + ?B.unifySpecific(x) + `-> false + `-> false + ?K.unifySpecific(L[[T]A[B[T]]]) + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?B.unifyFull(B[T]) + ?B.unifySpecific(B[T]) + ?B.addBound(B) + `-> true + ?K.addBound(L) + `-> true +?K.unifyFull(L[A]) + ?K.unifySpecific(L[A]) + ?K.addBound(L) + `-> true +?K.unifyFull(L[A]) + ?K.unifySpecific(L[A]) + ?K.addBound(L) `-> true ``` --- src/reflect/scala/reflect/internal/Types.scala | 7 +++---- test/files/pos/t7517.scala | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 test/files/pos/t7517.scala (limited to 'src') diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index ee584bed2c..0cc2b91a44 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -3218,10 +3218,9 @@ trait Types extends api.Types { self: SymbolTable => sameLength(typeArgs, tp.typeArgs) && { val lhs = if (isLowerBound) tp.typeArgs else typeArgs val rhs = if (isLowerBound) typeArgs else tp.typeArgs - // this is a higher-kinded type var with same arity as tp. - // side effect: adds the type constructor itself as a bound - addBound(tp.typeConstructor) - isSubArgs(lhs, rhs, params, AnyDepth) + // This is a higher-kinded type var with same arity as tp. + // If so (see SI-7517), side effect: adds the type constructor itself as a bound. + isSubArgs(lhs, rhs, params, AnyDepth) && { addBound(tp.typeConstructor); true } } } // The type with which we can successfully unify can be hidden diff --git a/test/files/pos/t7517.scala b/test/files/pos/t7517.scala new file mode 100644 index 0000000000..7ce4c6b13e --- /dev/null +++ b/test/files/pos/t7517.scala @@ -0,0 +1,22 @@ +trait Box[ K[A[x]] ] + +object Box { + // type constructor composition + sealed trait ∙[A[_], B[_]] { type l[T] = A[B[T]] } + + // composes type constructors inside K + type SplitBox[K[A[x]], B[x]] = Box[ ({ type l[A[x]] = K[ (A ∙ B)#l] })#l ] + + def split[ K[A[x]], B[x] ](base: Box[K]): SplitBox[K,B] = ??? + + class Composed[B[_], L[A[x]] ] { + val box: Box[L] = ??? + + type Split[ A[x] ] = L[ (A ∙ B)#l ] + val a: Box[Split] = Box.split(box) + + //Either of these work: + val a1: Box[Split] = Box.split[L,B](box) + val a2: Box[ ({ type l[A[x]] = L[ (A ∙ B)#l ] })#l ] = Box.split(box) + } +} \ No newline at end of file -- cgit v1.2.3 From 75251f76001d3c781b0630c2061603ebb250a787 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 30 May 2013 09:26:46 +0200 Subject: SI-7532 Fix regression in Java inner classfile reader 395e90a modified the detection of top-level classes in ClassfileParser in two ways: 1. used `Name#containsChar` rather than `toString.indexOf ...` (good!) 2. decoded the name before doing this check (bad!) That code is actually only run for non-Scala classfiles, whose names don't need decoding. Attempting to do so converted `R$attr` to `R@tr`, which no longer contains a '$', and was wrongly treated as a top level class. This commit reverts the use of `decodedName`, and inlines the method to its only call site for clarity. --- .../scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 8 ++++---- test/files/pos/t7532/A_1.java | 6 ++++++ test/files/pos/t7532/B_2.scala | 5 +++++ test/files/pos/t7532b/A_1.scala | 7 +++++++ test/files/pos/t7532b/B_2.scala | 8 ++++++++ 5 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 test/files/pos/t7532/A_1.java create mode 100644 test/files/pos/t7532/B_2.scala create mode 100644 test/files/pos/t7532b/A_1.scala create mode 100644 test/files/pos/t7532b/B_2.scala (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index da117540b4..47a8b1f947 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -44,8 +44,6 @@ abstract class ClassfileParser { def srcfile = srcfile0 - private def currentIsTopLevel = !(currentClass.decodedName containsChar '$') - private object unpickler extends scala.reflect.internal.pickling.UnPickler { val global: ClassfileParser.this.global.type = ClassfileParser.this.global } @@ -515,8 +513,10 @@ abstract class ClassfileParser { } } - val c = if (currentIsTopLevel) pool.getClassSymbol(nameIdx) else clazz - if (currentIsTopLevel) { + val isTopLevel = !(currentClass containsChar '$') // Java class name; *don't* try to to use Scala name decoding (SI-7532) + + val c = if (isTopLevel) pool.getClassSymbol(nameIdx) else clazz + if (isTopLevel) { if (c != clazz) { if ((clazz eq NoSymbol) && (c ne NoSymbol)) clazz = c else mismatchError(c) diff --git a/test/files/pos/t7532/A_1.java b/test/files/pos/t7532/A_1.java new file mode 100644 index 0000000000..1ade76cc70 --- /dev/null +++ b/test/files/pos/t7532/A_1.java @@ -0,0 +1,6 @@ +class R { + public class attr { // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + } + public static class attr1 { + } +} diff --git a/test/files/pos/t7532/B_2.scala b/test/files/pos/t7532/B_2.scala new file mode 100644 index 0000000000..ee7ce7751f --- /dev/null +++ b/test/files/pos/t7532/B_2.scala @@ -0,0 +1,5 @@ +object Test { + val r = new R + new r.attr() // Was: error while loading attr, class file '.../t7532-pos.obj/R$attr.class' has location not matching its contents: contains class + new R.attr1 +} \ No newline at end of file diff --git a/test/files/pos/t7532b/A_1.scala b/test/files/pos/t7532b/A_1.scala new file mode 100644 index 0000000000..e8f9540609 --- /dev/null +++ b/test/files/pos/t7532b/A_1.scala @@ -0,0 +1,7 @@ +package pack +class R { + class attr // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + class `@` +} + +class `@` \ No newline at end of file diff --git a/test/files/pos/t7532b/B_2.scala b/test/files/pos/t7532b/B_2.scala new file mode 100644 index 0000000000..1555a5daa7 --- /dev/null +++ b/test/files/pos/t7532b/B_2.scala @@ -0,0 +1,8 @@ +import pack._ + +object Test { + val r = new R + new r.attr() + new r.`@` + new `@` +} \ No newline at end of file -- cgit v1.2.3