File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4518,7 +4518,9 @@ object Types {
4518
4518
case et : ExprType => true
4519
4519
case _ => false
4520
4520
}
4521
- if (tp.cls.is(Trait ) || zeroParams(tp.cls.primaryConstructor.info)) tp // !!! needs to be adapted once traits have parameters
4521
+ // `ImplicitFunctionN` does not have constructors
4522
+ val ctor = tp.cls.primaryConstructor
4523
+ if (! ctor.exists || zeroParams(ctor.info)) tp
4522
4524
else NoType
4523
4525
case tp : AppliedType =>
4524
4526
zeroParamClass(tp.superType)
Original file line number Diff line number Diff line change
1
+ trait Evidence [X ]
2
+
3
+ trait Trait [X : Evidence ]
4
+ def method (x : X ) : X
5
+
6
+ given ev : Evidence [Int ] = new Evidence [Int ]{}
7
+ val crash : Trait [Int ] = (x : Int ) => x // error
You can’t perform that action at this time.
0 commit comments