File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ trait FieldInfo {
2
+ val fieldType : ALL_TYPE
3
+ }
4
+
5
+ opaque type TypeSymbol = String
6
+
7
+ trait ConcreteType {
8
+ val name : String
9
+ val typeParameters : List [TypeSymbol ]
10
+ val isUnion : Boolean = false
11
+ }
12
+
13
+ trait UnionContainer {
14
+ val hasUnion : Boolean
15
+ }
16
+
17
+ type ALL_TYPE = ConcreteType | TypeSymbol
18
+
19
+ case class StaticUnionInfo (name : String , typeParameters : List [TypeSymbol ]) extends ConcreteType
20
+ case class AliasInfo (name : String , typeParameters : List [TypeSymbol ]) extends ConcreteType
21
+
22
+ object UnionKind {
23
+ def unapply (f : FieldInfo ): Boolean =
24
+ f.fieldType match {
25
+ case _ : StaticUnionInfo => true
26
+ case t : AliasInfo if t.isUnion => true
27
+ case t : UnionContainer if t.hasUnion => true // this line here causes crash
28
+ case _ => false
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments