File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -93,10 +93,11 @@ object SymDenotations {
93
93
if (myFlags.is(Trait )) NoInitsInterface & bodyFlags // no parents are initialized from a trait
94
94
else NoInits & bodyFlags & parentFlags)
95
95
96
- private def isCurrent (fs : FlagSet ) =
97
- fs <= (
98
- if (myInfo.isInstanceOf [SymbolLoader ]) FromStartFlags
99
- else AfterLoadFlags )
96
+ def isCurrent (fs : FlagSet )(using Context ): Boolean =
97
+ def knownFlags (info : Type ): FlagSet = info match
98
+ case _ : SymbolLoader | _ : ModuleCompleter => FromStartFlags
99
+ case _ => AfterLoadFlags
100
+ ! myInfo.isInstanceOf [LazyType ] || fs <= knownFlags(myInfo)
100
101
101
102
final def relevantFlagsFor (fs : FlagSet )(using Context ) =
102
103
if (isCurrent(fs)) myFlags else flags
Original file line number Diff line number Diff line change
1
+ package dotty .tools .repl
2
+
3
+ import org .junit .Assert ._
4
+ import org .junit .Test
5
+
6
+ class JavaDefinedTests extends ReplTest {
7
+ @ Test def typeOfJavaDefinedString = fromInitialState { implicit s =>
8
+ run(" String" )
9
+ assertTrue(storedOutput().contains(" Java defined class String is not a value" ))
10
+ }
11
+
12
+ @ Test def typeOfJavaDefinedClass = fromInitialState { implicit s =>
13
+ run(" Class" )
14
+ assertTrue(storedOutput().contains(" Java defined class Class is not a value" ))
15
+ }
16
+ }
Original file line number Diff line number Diff line change
1
+ @ main def Test () = String // error
2
+
You can’t perform that action at this time.
0 commit comments