Skip to content

Commit 785f107

Browse files
committed
Update todo.scala and Add examples to debug
1 parent f324436 commit 785f107

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
class C[T](x: T)[U](y: U){
3+
def pair: (T,U) = (x,y)
4+
def first = x
5+
def second = y
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
class A{
3+
def f0[T][U](x: Any) = ???
4+
def f0[T][U](x: Int) = ???
5+
6+
f0(1)
7+
8+
}

tests/pos/_typeInterweaving/todo.scala

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ def foo[T, U][V](x: T): U = ???
2424
* ParamClauses ::= ParamClause {ParamClause}
2525
* ParamClause ::= TermParamClause | TypeParamClause | UsingParamClause
2626
* TermParamClause ::= [nl] ‘(’ [TermParams] ‘)’ //note: allows ()
27-
* TypeParamClause ::= [nl] ‘[’ TypeParams ‘]’
27+
* TypeParamClause ::= [nl] ‘[’ TypeParams ‘]’
2828
* UsingParamClause ::= [nl] ‘(’ ‘using’ TermParams ‘)’
2929
*
3030
* (slightly simpler but should be equivalent to changes made in Parser.scla)
3131
*/
3232
// same for classes, je suis un peu confus par la syntaxe ci-dessous, notament Annotation et AccessModifiers, ils sont pas là en scala 3, non ?
3333
// https://www.scala-lang.org/files/archive/spec/2.13/05-classes-and-objects.html#class-definitions
34+
//
35+
// change text to explain application notably when only passed one clause of type params when multiple type clauses expected
3436

35-
// impl param de classe, déjà Parser
37+
// impl param de classe, déjà Parser: Done
38+
39+
40+
//add function call to chainedParams
3641

3742

3843
// Que faire de TypeDcl ::= id [TypeParamClause] {FunParamClause} TypeBounds [‘=’ Type] //TODO: change to {ParamClauses} ?
@@ -42,7 +47,9 @@ def foo[T, U][V](x: T): U = ???
4247
function definition Done
4348
function application Already works
4449
class definition In Progress
45-
class instantiation Might already work
50+
primary constr In Progress
51+
auxiliary constr In Progress
52+
class instantiation Might already work // see new
4653
given definition Todo
4754
given application(?) Doesn't exist ? or add multiple params to usings ?
4855
type declarations To be determined
@@ -63,4 +70,27 @@ def foo[T, U][V](x: T): U = ???
6370
//potentiellement cette feature en experimental
6471

6572
// eta expension:
66-
val f = foo //should work and doesn't preserve type params yet
73+
val f = foo //should work and doesn't preserve type params yet
74+
75+
76+
77+
78+
79+
//new:
80+
// mettre de coté la partie sur les classes
81+
// fork le repo de la doc est faire changements appropriés
82+
// check overloading resolution
83+
// Applications.scala resolveMapped
84+
// methType
85+
// ProtoTypes.scala
86+
87+
// check ne passer aucun arguments à une fonction
88+
// voir fichier overload dans pos/interweaving_
89+
// voir methType
90+
// check occurances de PolyType et PolyProto pour être sûr que ça fonctionne bien avec les [T][U]
91+
// testCompilation
92+
93+
94+
95+
// should we allow fun[L <: List[T]][T] as alias for something like fun[F[_] <: List[]][T][L <: F[T]]
96+
// I'm not sure it's useful

0 commit comments

Comments
 (0)