Skip to content

Commit 34b98f3

Browse files
authored
Merge pull request #2501 from dotty-staging/add-phantom-doc
Add note on phantom universe mismatch
2 parents b7f5bf9 + 8238c8e commit 34b98f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ object ErrorReporting {
120120
val expected1 = dropJavaMethod(expected)
121121
if ((found1 eq found) != (expected eq expected1) && (found1 <:< expected1))
122122
"\n (Note that Scala's and Java's representation of this type differs)"
123+
else if (found.topType != expected.topType)
124+
"\n (Note that the types are in different universes, see Phantom types)"
123125
else if (ctx.settings.explainTypes.value)
124126
"\n" + ctx.typerState.show + "\n" + TypeComparer.explained((found <:< expected)(_))
125127
else

0 commit comments

Comments
 (0)