File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2066,6 +2066,9 @@ object Types {
2066
2066
*/
2067
2067
abstract case class RefinedType (parent : Type , refinedName : Name , refinedInfo : Type ) extends RefinedOrRecType {
2068
2068
2069
+ if (refinedName.isTermName) assert(refinedInfo.isInstanceOf [TermType ])
2070
+ else assert(refinedInfo.isInstanceOf [TypeType ])
2071
+
2069
2072
override def underlying (implicit ctx : Context ) = parent
2070
2073
2071
2074
private def badInst =
Original file line number Diff line number Diff line change
1
+ malformed type
Original file line number Diff line number Diff line change
1
+ import dotty .tools .dotc ._
2
+ import core ._
3
+ import Types ._
4
+ import Contexts ._
5
+ import Symbols ._
6
+ import Decorators ._
7
+
8
+ object Test {
9
+ def f (implicit ctx : Context ) = {
10
+ val badType =
11
+ RefinedType (
12
+ ctx.requiredClassRef(" scala.collection.AbstractIterator" ),
13
+ " GroupedIterator" .toTypeName,
14
+ TypeRef (ctx.requiredClassRef(" scala.collection.AbstractIterator" ), " GroupedIterator" .toTypeName))
15
+ badType.member(" GroupedIterator" .toTypeName)
16
+ // badType.member("T".toTypeName)
17
+ }
18
+ def main (args : Array [String ]): Unit = {
19
+ implicit val ctx = (new ContextBase ).initialCtx
20
+ ctx.base.initialize()
21
+ try f
22
+ catch {
23
+ case ex : AssertionError => println(" malformed type" )
24
+ }
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments