Skip to content

Commit

Permalink
Pretty alignment and check file showing message
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jan 3, 2024
1 parent bff12be commit 14e0f90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/src/dotty/tools/dotc/reporting/Message.scala
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ object Message:
case param: TypeParamRef => ctx.typerState.constraint.contains(param)
case param: ParamRef => false
case skolem: SkolemType => true
case sym: Symbol =>
ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds.empty
case sym: Symbol => ctx.gadt.contains(sym) && ctx.gadt.fullBounds(sym) != TypeBounds.empty
}

val toExplain: List[(String, Recorded)] = seen.toList.flatMap { kvs =>
Expand Down
12 changes: 12 additions & 0 deletions tests/neg/i19334.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- [E081] Type Error: tests/neg/i19334.scala:6:4 -----------------------------------------------------------------------
6 | f(_) // error was OOM formatting TypeVar(TypeParamRef(T)) when offering explanations
| ^
| Missing parameter type
|
| I could not infer the type of the parameter _$1
| in expanded function:
| _$1 => f(_$1)
| Expected type for the whole anonymous function:
| T
|
| where: T is a type variable

0 comments on commit 14e0f90

Please sign in to comment.