File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,15 @@ trait TypeAssigner {
53
53
def addRefinement (parent : Type , decl : Symbol ) = {
54
54
val inherited =
55
55
parentType.findMember(decl.name, cls.thisType,
56
- required = EmptyFlags , excluded = Private )
57
- .suchThat(decl.matches(_))
56
+ required = EmptyFlags , excluded = Private
57
+ ) .suchThat(decl.matches(_))
58
58
val inheritedInfo = inherited.info
59
59
val isPolyFunctionApply = decl.name == nme.apply && (parent <:< defn.PolyFunctionType )
60
60
if isPolyFunctionApply
61
61
|| inheritedInfo.exists
62
+ && ! decl.isClass
62
63
&& decl.info.widenExpr <:< inheritedInfo.widenExpr
63
64
&& ! (inheritedInfo.widenExpr <:< decl.info.widenExpr)
64
- && ! decl.isClass
65
65
then
66
66
val r = RefinedType (parent, decl.name, decl.info)
67
67
typr.println(i " add ref $parent $decl --> " + r)
Original file line number Diff line number Diff line change @@ -3,10 +3,13 @@ trait ZSink {
3
3
type State
4
4
5
5
def foo : ZSink =
6
- class Anon extends ZSink
6
+ class Anon extends ZSink {
7
7
case class State (x : Int )
8
+ }
8
9
new Anon
9
- // new ZSink {
10
- // case class State(x: Int)
11
- // }
10
+
11
+ def foo2 : ZSink =
12
+ new ZSink {
13
+ case class State (x : Int )
14
+ }
12
15
}
You can’t perform that action at this time.
0 commit comments