We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32b35ec + e15c605 commit f8e4ed3Copy full SHA for f8e4ed3
tests/pos/i8357.scala
@@ -0,0 +1,30 @@
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
0 commit comments