Skip to content

Commit dad48ad

Browse files
committed
Check file for -explain output
1 parent 5a6055e commit dad48ad

File tree

4 files changed

+78
-12
lines changed

4 files changed

+78
-12
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class CompilationTests {
145145
compileFile("tests/neg-custom-args/i4372.scala", allowDeepSubtypes),
146146
compileFile("tests/neg-custom-args/i1754.scala", allowDeepSubtypes),
147147
compileFile("tests/neg-custom-args/i9517.scala", defaultOptions.and("-Xprint-types")),
148+
compileFile("tests/neg-custom-args/i11637.scala", defaultOptions.and("-explain")),
148149
compileFile("tests/neg-custom-args/interop-polytypes.scala", allowDeepSubtypes.and("-Yexplicit-nulls")),
149150
compileFile("tests/neg-custom-args/conditionalWarnings.scala", allowDeepSubtypes.and("-deprecation").and("-Xfatal-warnings")),
150151
compileFilesInDir("tests/neg-custom-args/isInstanceOf", allowDeepSubtypes and "-Xfatal-warnings"),

tests/neg-custom-args/i11637.check

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
-- [E057] Type Mismatch Error: tests/neg-custom-args/i11637.scala:11:33 ------------------------------------------------
2+
11 | var h = new HKT3_1[FunctorImpl](); // error // error
3+
| ^
4+
| Type argument test2.FunctorImpl does not conform to upper bound [Generic2[T] <: Set[T]] =>> Any
5+
6+
Explanation
7+
===========
8+
9+
I tried to show that
10+
test2.FunctorImpl
11+
conforms to
12+
[Generic2[T] <: Set[T]] =>> Any
13+
but the comparison trace ended with `false`:
14+
15+
==> test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any
16+
==> test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any (recurring)
17+
==> type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]]
18+
==> type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] (recurring)
19+
==> [T <: String] =>> Set[T] <: Iterable
20+
==> [T <: String] =>> Set[T] <: Iterable (recurring)
21+
==> type bounds [] <: type bounds [ <: String]
22+
==> type bounds [] <: type bounds [ <: String] (recurring)
23+
==> Any <: String
24+
==> Any <: String (recurring)
25+
==> Any <: String (recurring)
26+
<== Any <: String (recurring) = false
27+
<== Any <: String (recurring) = false
28+
<== Any <: String = false
29+
<== type bounds [] <: type bounds [ <: String] (recurring) = false
30+
<== type bounds [] <: type bounds [ <: String] = false
31+
<== [T <: String] =>> Set[T] <: Iterable (recurring) = false
32+
<== [T <: String] =>> Set[T] <: Iterable = false
33+
<== type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] (recurring) = false
34+
<== type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] = false
35+
<== test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any (recurring) = false
36+
<== test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any = false
37+
38+
The tests were made under the empty constraint
39+
40+
-- [E057] Type Mismatch Error: tests/neg-custom-args/i11637.scala:11:21 ------------------------------------------------
41+
11 | var h = new HKT3_1[FunctorImpl](); // error // error
42+
| ^
43+
| Type argument test2.FunctorImpl does not conform to upper bound [Generic2[T] <: Set[T]] =>> Any
44+
45+
Explanation
46+
===========
47+
48+
I tried to show that
49+
test2.FunctorImpl
50+
conforms to
51+
[Generic2[T] <: Set[T]] =>> Any
52+
but the comparison trace ended with `false`:
53+
54+
==> test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any
55+
==> test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any (recurring)
56+
==> type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]]
57+
==> type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] (recurring)
58+
==> [T <: String] =>> Set[T] <: Iterable
59+
==> [T <: String] =>> Set[T] <: Iterable (recurring)
60+
==> type bounds [] <: type bounds [ <: String]
61+
==> type bounds [] <: type bounds [ <: String] (recurring)
62+
==> Any <: String
63+
==> Any <: String (recurring)
64+
==> Any <: String (recurring)
65+
<== Any <: String (recurring) = false
66+
<== Any <: String (recurring) = false
67+
<== Any <: String = false
68+
<== type bounds [] <: type bounds [ <: String] (recurring) = false
69+
<== type bounds [] <: type bounds [ <: String] = false
70+
<== [T <: String] =>> Set[T] <: Iterable (recurring) = false
71+
<== [T <: String] =>> Set[T] <: Iterable = false
72+
<== type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] (recurring) = false
73+
<== type bounds [[T] <: Set[T]] <: type bounds [[T] <: Iterable[T]] = false
74+
<== test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any (recurring) = false
75+
<== test2.FunctorImpl <: [Generic2[T] <: Set[T]] =>> Any = false
76+
77+
The tests were made under the empty constraint
File renamed without changes.

tests/neg/i11637.check

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)