Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
0036ecb
First version of RefineTypes
odersky May 17, 2021
4a3eb52
Create fresh TypeVars when refining
odersky May 19, 2021
247f4e0
Fix typedSelect for avoiding private members
odersky May 20, 2021
febed32
Remember instantiation direction of type variables
odersky May 20, 2021
7cfc1cf
Don't use inst for class linking
odersky May 20, 2021
451059a
Leave types as they are for outer references
odersky May 21, 2021
1aca428
Prefer old instance over extremal bound when refining
odersky May 21, 2021
66ea734
Rename TypeVarBinder --> InferredTypeTree
odersky May 22, 2021
4a8b619
Cleanups
odersky May 22, 2021
b49fcc5
Move typedTyped from ReTyper
odersky May 22, 2021
7feecda
Add some logic needed for Namer
odersky May 22, 2021
3a7275b
Pull out inferredResultType into separate method
odersky May 25, 2021
6158498
Re-infer inferred types of ValDefs and DefDefs
odersky May 25, 2021
800e831
Improve expected types for dependent functions
odersky May 25, 2021
52be81e
Fix owners for completion contexts
odersky May 25, 2021
f0f1fb0
Make refiners conditional on -Yrefine-types
odersky May 25, 2021
fc04aa1
Fix typevar instantiation to allow several instantiate calls
odersky May 25, 2021
dfeea9b
Add InferredTypeTree to Trees.Instance
odersky May 27, 2021
47dd4a3
Retype inferred closure parameters
odersky May 27, 2021
054708e
Add tastyBootstrap to refine tests
odersky May 28, 2021
9776b16
Replace leaked type variables bound in callee
odersky May 28, 2021
72caef3
Fix rebase breakage
odersky Jun 5, 2021
87a3e02
Re-propagate result types of anonymous functions
odersky Jun 8, 2021
0d2de67
Readapt to latest master
odersky Jun 8, 2021
c565d08
Re-infer type ascriptions added in ensureNoLocalRefs
odersky Jun 9, 2021
06d8093
Declare that PreRefine can change base types
odersky Jun 9, 2021
538e211
Re-infer types of symbols in local and private classes
odersky Jun 12, 2021
6c95ccc
Add functionality to SimpleIdentitySet
odersky Jun 5, 2021
5a2cd34
Basic support for CapturingType
odersky Jun 5, 2021
7ae43f3
Pickling and unpickling of capturing types
odersky Jun 5, 2021
758d7cd
Add support for CapturingTypes elsewhere
odersky Jun 5, 2021
789b04e
Add TopType
odersky Jun 5, 2021
9457e54
Don't check capture sets in bounds checks
odersky Jun 5, 2021
7b65772
Some tests
odersky Jun 5, 2021
1a6d694
Refactor LambdaLift
odersky Jun 6, 2021
7bffc31
Enrich Types infrastructure for captures
odersky Jun 6, 2021
9af8498
Add CheckCaptures phase
odersky Jun 6, 2021
b79931e
Normalize refs in CapturingTypes and CaptureSets
odersky Jun 7, 2021
91cb1bc
Add missing case in type comparer
odersky Jun 7, 2021
bd1da71
Typecheck applications
odersky Jun 7, 2021
2905795
Ignore `holds` unless `-Yrefine-types` is set
odersky Jun 7, 2021
6cee8c0
Introduce -Ycc setting
odersky Jun 7, 2021
2f085ac
Fix tests
odersky Jun 7, 2021
c6fc5f3
Move capture parameter substitution into normal typer
odersky Jun 7, 2021
ea7012a
More fixes and tests
odersky Jun 8, 2021
ecaa1c1
Fix TypeMap for CapturingTypes
odersky Jun 8, 2021
890aa72
Improve error message
odersky Jun 8, 2021
662e76b
Make "capture `*`" check configurable
odersky Jun 11, 2021
e273bfa
Update tests
odersky Jun 11, 2021
3206e9a
Fix argForParam
odersky Jun 11, 2021
3e8b0f6
Fix printing of function type trees
odersky Jun 11, 2021
a537a40
Declare subcategories of abilities with @ability
odersky Jun 11, 2021
6c5a1cb
Rename holds -> retains
odersky Jun 11, 2021
2b60994
Define capture sets of classes
odersky Jun 11, 2021
64d6875
Test curried tries
odersky Jun 11, 2021
efeec2d
Simplify singleton subtype rule
odersky Jun 11, 2021
1750139
Refuse to instantiate type variables with other global capabilities
odersky Jun 11, 2021
f5611e3
Fixes and well-formedness check for capture-dependent types
odersky Jun 11, 2021
0341f7f
Also check well-formedness of method signatures
odersky Jun 12, 2021
e15bfc4
Add List encoding test
odersky Jun 12, 2021
4e349cc
Fix joins and join approximations of capturing types
odersky Jun 12, 2021
e96f653
Target minor version
odersky Jun 15, 2021
8af8dbc
Fix rebase breakage
odersky Jun 15, 2021
639361b
Allow curried methods that refer to capture refs contravariantly
odersky Jun 16, 2021
6cc124e
Avoid abbreviation in warning
odersky Jun 16, 2021
de62914
Tests for strict and lazy maps over boxes
odersky Jun 16, 2021
9fb45c9
Fix neg test
odersky Jun 16, 2021
c03b577
Revert "Target minor version"
odersky Jun 17, 2021
7433f3f
Drop implementation restriction for polymorphic functions
odersky Jun 17, 2021
797e261
Fix arity check
odersky Jun 17, 2021
d1fab19
Add IO test
odersky Jun 17, 2021
3a2190a
Merge pull request #12863 from dotty-staging/generalize-polyfuns
odersky Jun 18, 2021
fe31d81
Merge pull request #12859 from dotty-staging/add-io-test
odersky Jun 18, 2021
c226577
Refactor tests and fix isGlobal
odersky Jun 19, 2021
acc93bb
Fix printing of poly function types
odersky Jun 19, 2021
87c92d1
Allow capturing types as CFT protos
odersky Jun 19, 2021
651b791
Don't print trees twice after refiner phases
odersky Jun 19, 2021
f5d25da
Shallow capture sets
odersky Jun 19, 2021
9b7fe8b
Fix condition in TreeChecker
odersky Jun 19, 2021
3cf68e3
Fix precedence of dependent and poly function printing
odersky Jun 19, 2021
25b23c1
Fix capture sets of applied types
odersky Jun 20, 2021
27c9fc5
Fix decomposeProto
odersky Jun 20, 2021
988c4c0
Adapt tests to shallow capture sets
odersky Jun 20, 2021
6977ad1
Handle TypeVars in CaptureSets
odersky Jun 21, 2021
cceff77
Assume capture sets of result type in enclosing function
odersky Jun 21, 2021
7a282ad
Drop unused val in appliedTo
odersky Jun 21, 2021
59151bd
Print `retains` type trees infix
odersky Jun 21, 2021
18e768c
Merge pull request #12875 from dotty-staging/shallow-capture-sets
odersky Jun 28, 2021
5043610
Generalize rule for inferring capture sets from the result type.
odersky Jul 2, 2021
d579930
Simplify typedAhead methods
odersky Jul 3, 2021
098833e
Workarounds for scala-meta failures
odersky Jul 5, 2021
5ffb5d6
Support abbreviated capturing annotations
odersky Jul 5, 2021
5e072e4
Print capturing types as in paper
odersky Jul 5, 2021
78760e2
Allow paper syntax to parse capturing types
odersky Jul 5, 2021
c1dc47b
Tweak type expansion
odersky Jul 5, 2021
2d22ac2
Merge pull request #13005 from dotty-staging/more-abbrevs
odersky Jul 5, 2021
590016e
Make CapturingTypes take sets instead of single references
odersky Jul 6, 2021
986ad66
Allow given capture sets to be empty
odersky Jul 6, 2021
b4b5bfd
Convert test to new syntax
odersky Jul 6, 2021
55dc64a
Merge pull request #13022 from dotty-staging/more-abbrevs
odersky Jul 8, 2021
7e196e5
implement map function for list-encoding test
olhotak Jun 17, 2021
02f55b9
add map2 that switches order of list and function
olhotak Jun 17, 2021
da6953e
attempt to add lazyMap
olhotak Jun 22, 2021
885c21f
correct capture sets in lazyMap
olhotak Jun 22, 2021
4f95d79
working implementation of lazymap
olhotak Jun 25, 2021
f72ee35
minimize list-encoding to debug Ycheck failure
olhotak Jun 29, 2021
e8b33bc
turn off Ycheck and uncomment list-encoding examples
olhotak Jul 2, 2021
ef0b60f
use unions to simplify multiple retains
olhotak Jul 2, 2021
20fda86
simplify type of lazyMap
olhotak Jul 2, 2021
402eda1
add lazyPureMap
olhotak Jul 2, 2021
3c980a9
use abbreviated/paper syntax in list examples
olhotak Jul 5, 2021
74e5590
remove unnecessary consForLazyMap
olhotak Jul 5, 2021
3722a9c
specify empty capture sets for pure functions
olhotak Jul 6, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add IO test
  • Loading branch information
odersky committed Jun 17, 2021
commit d1fab190f6db4c1184af6b02e3db585d7f76e70a
21 changes: 21 additions & 0 deletions tests/neg-custom-args/captures/io.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sealed trait IO:
def puts(msg: Any): Unit = println(msg)

def test1 =
val IO : IO retains * = new IO {}
def foo = IO.puts("hello")
val x : () => Unit = () => foo // error: Found: (() => Unit) retains IO; Required: () => Unit

def test2 =
val IO : IO retains * = new IO {}
def puts(msg: Any, io: IO retains *) = println(msg)
def foo() = puts("hello", IO)
val x : () => Unit = () => foo() // error: Found: (() => Unit) retains IO; Required: () => Unit

type Capability[T] = T retains *

def test3 =
val IO : Capability[IO] = new IO {}
def puts(msg: Any, io: Capability[IO]) = println(msg)
def foo() = puts("hello", IO)
val x : () => Unit = () => foo() // error: Found: (() => Unit) retains IO; Required: () => Unit