-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change isStatic to isStaticOwner in hasLocalInstantiation
Co-Authored-By: Dale Wijnand <[email protected]> Co-Authored-By: noti0na1 <[email protected]> Co-Authored-By: odersky <[email protected]>
- Loading branch information
1 parent
9715eed
commit cd89fed
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
object helper { | ||
def assertNoParams(cls: Class[?]) = assert(cls.getConstructors()(0).getParameterCount == 0) | ||
} | ||
import helper.assertNoParams | ||
|
||
object T1 { class C1; assertNoParams(classOf[C1]) } | ||
object T2 { new AnyRef { class C2; assertNoParams(classOf[C2]) } } | ||
object T3 { def t3(): Unit = { class C3; assertNoParams(classOf[C3]) } } | ||
object T4 { def t4(): Unit = new AnyRef { class C4; assertNoParams(classOf[C4]) } } | ||
|
||
//class T5 { class C5; assertNoParams(classOf[C5]) } | ||
class T6 { new AnyRef { class C6; assertNoParams(classOf[C6]) } } | ||
class T7 { def t7(): Unit = { class C7; assertNoParams(classOf[C7]) } } | ||
class T8 { def t8(): Unit = new AnyRef { class C8; assertNoParams(classOf[C8]) } } | ||
|
||
object Test { | ||
def main(args: Array[String]): Unit = { | ||
T1.toString | ||
T2.toString | ||
T3.t3() | ||
T4.t4() | ||
//new T5().toString | ||
new T6().toString | ||
new T7().t7() | ||
new T8().t8() | ||
} | ||
} |