-
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.
- Loading branch information
Showing
3 changed files
with
49 additions
and
13 deletions.
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
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,32 @@ | ||
|
||
//> using options -Wunused:all | ||
|
||
object events { | ||
final val PollOut = 0x002 | ||
transparent inline def POLLIN = 0x001 | ||
} | ||
|
||
def withShort(v: Short): Unit = ??? | ||
def withInt(v: Int): Unit = ??? | ||
|
||
def usage() = | ||
import events.POLLIN // reports unused | ||
def v: Short = POLLIN | ||
println(v) | ||
|
||
def usage2() = | ||
import events.POLLIN // reports unused | ||
withShort(POLLIN) | ||
|
||
def usage3() = | ||
import events.POLLIN // does not report unused | ||
withInt(POLLIN) | ||
|
||
def usage4() = | ||
import events.POLLIN // reports unused | ||
withShort(POLLIN) | ||
|
||
def value = 42 | ||
def withDouble(v: Double): Unit = ??? | ||
def usage5() = withDouble(value) | ||
def usage6() = withShort(events.POLLIN) |