| 1 |
# Tests identifying names which must be types from context |
| 2 |
|
| 3 |
---input--- |
| 4 |
Union{} |
| 5 |
MyType{Nothing, Any} |
| 6 |
f(::Union{T,S}) where S where T = 1 |
| 7 |
f(::T) where {T} = 1 |
| 8 |
f(::Type{<:T}) = 1 |
| 9 |
f(::AT) where AT <: AbstractArray{MyType,1} = 1 |
| 10 |
f(::Val{:named}) = 1 |
| 11 |
f(::typeof(sin)) = 1 |
| 12 |
MyInt <: Integer |
| 13 |
Number >: MyInt |
| 14 |
AT{T,1} <: B |
| 15 |
B>:AT{T,1} |
| 16 |
A <: f(B) |
| 17 |
g(C) <: T |
| 18 |
|
| 19 |
---tokens--- |
| 20 |
'Union' Keyword.Type |
| 21 |
'{' Punctuation |
| 22 |
'}' Punctuation |
| 23 |
'\n' Text.Whitespace |
| 24 |
|
| 25 |
'MyType' Keyword.Type |
| 26 |
'{' Punctuation |
| 27 |
'Nothing' Keyword.Type |
| 28 |
',' Punctuation |
| 29 |
' ' Text.Whitespace |
| 30 |
'Any' Keyword.Type |
| 31 |
'}' Punctuation |
| 32 |
'\n' Text.Whitespace |
| 33 |
|
| 34 |
'f' Name |
| 35 |
'(' Punctuation |
| 36 |
'::' Operator |
| 37 |
'Union' Keyword.Type |
| 38 |
'{' Punctuation |
| 39 |
'T' Keyword.Type |
| 40 |
',' Punctuation |
| 41 |
'S' Keyword.Type |
| 42 |
'}' Punctuation |
| 43 |
')' Punctuation |
| 44 |
' ' Text.Whitespace |
| 45 |
'where' Keyword |
| 46 |
' ' Text.Whitespace |
| 47 |
'S' Keyword.Type |
| 48 |
' ' Text.Whitespace |
| 49 |
'where' Keyword |
| 50 |
' ' Text.Whitespace |
| 51 |
'T' Keyword.Type |
| 52 |
' ' Text.Whitespace |
| 53 |
'=' Operator |
| 54 |
' ' Text.Whitespace |
| 55 |
'1' Literal.Number.Integer |
| 56 |
'\n' Text.Whitespace |
| 57 |
|
| 58 |
'f' Name |
| 59 |
'(' Punctuation |
| 60 |
'::' Operator |
| 61 |
'T' Keyword.Type |
| 62 |
')' Punctuation |
| 63 |
' ' Text.Whitespace |
| 64 |
'where' Keyword |
| 65 |
' ' Text.Whitespace |
| 66 |
'{' Punctuation |
| 67 |
'T' Keyword.Type |
| 68 |
'}' Punctuation |
| 69 |
' ' Text.Whitespace |
| 70 |
'=' Operator |
| 71 |
' ' Text.Whitespace |
| 72 |
'1' Literal.Number.Integer |
| 73 |
'\n' Text.Whitespace |
| 74 |
|
| 75 |
'f' Name |
| 76 |
'(' Punctuation |
| 77 |
'::' Operator |
| 78 |
'Type' Keyword.Type |
| 79 |
'{' Punctuation |
| 80 |
'<:' Operator |
| 81 |
'T' Keyword.Type |
| 82 |
'}' Punctuation |
| 83 |
')' Punctuation |
| 84 |
' ' Text.Whitespace |
| 85 |
'=' Operator |
| 86 |
' ' Text.Whitespace |
| 87 |
'1' Literal.Number.Integer |
| 88 |
'\n' Text.Whitespace |
| 89 |
|
| 90 |
'f' Name |
| 91 |
'(' Punctuation |
| 92 |
'::' Operator |
| 93 |
'AT' Keyword.Type |
| 94 |
')' Punctuation |
| 95 |
' ' Text.Whitespace |
| 96 |
'where' Keyword |
| 97 |
' ' Text.Whitespace |
| 98 |
'AT' Keyword.Type |
| 99 |
' ' Text.Whitespace |
| 100 |
'<:' Operator |
| 101 |
' ' Text.Whitespace |
| 102 |
'AbstractArray' Keyword.Type |
| 103 |
'{' Punctuation |
| 104 |
'MyType' Keyword.Type |
| 105 |
',' Punctuation |
| 106 |
'1' Literal.Number.Integer |
| 107 |
'}' Punctuation |
| 108 |
' ' Text.Whitespace |
| 109 |
'=' Operator |
| 110 |
' ' Text.Whitespace |
| 111 |
'1' Literal.Number.Integer |
| 112 |
'\n' Text.Whitespace |
| 113 |
|
| 114 |
'f' Name |
| 115 |
'(' Punctuation |
| 116 |
'::' Operator |
| 117 |
'Val' Keyword.Type |
| 118 |
'{' Punctuation |
| 119 |
':named' Literal.String.Symbol |
| 120 |
'}' Punctuation |
| 121 |
')' Punctuation |
| 122 |
' ' Text.Whitespace |
| 123 |
'=' Operator |
| 124 |
' ' Text.Whitespace |
| 125 |
'1' Literal.Number.Integer |
| 126 |
'\n' Text.Whitespace |
| 127 |
|
| 128 |
'f' Name |
| 129 |
'(' Punctuation |
| 130 |
'::' Operator |
| 131 |
'typeof' Name |
| 132 |
'(' Punctuation |
| 133 |
'sin' Name |
| 134 |
')' Punctuation |
| 135 |
')' Punctuation |
| 136 |
' ' Text.Whitespace |
| 137 |
'=' Operator |
| 138 |
' ' Text.Whitespace |
| 139 |
'1' Literal.Number.Integer |
| 140 |
'\n' Text.Whitespace |
| 141 |
|
| 142 |
'MyInt' Keyword.Type |
| 143 |
' ' Text.Whitespace |
| 144 |
'<:' Operator |
| 145 |
' ' Text.Whitespace |
| 146 |
'Integer' Keyword.Type |
| 147 |
'\n' Text.Whitespace |
| 148 |
|
| 149 |
'Number' Keyword.Type |
| 150 |
' ' Text.Whitespace |
| 151 |
'>:' Operator |
| 152 |
' ' Text.Whitespace |
| 153 |
'MyInt' Keyword.Type |
| 154 |
'\n' Text.Whitespace |
| 155 |
|
| 156 |
'AT' Keyword.Type |
| 157 |
'{' Punctuation |
| 158 |
'T' Keyword.Type |
| 159 |
',' Punctuation |
| 160 |
'1' Literal.Number.Integer |
| 161 |
'}' Punctuation |
| 162 |
' ' Text.Whitespace |
| 163 |
'<:' Operator |
| 164 |
' ' Text.Whitespace |
| 165 |
'B' Keyword.Type |
| 166 |
'\n' Text.Whitespace |
| 167 |
|
| 168 |
'B' Keyword.Type |
| 169 |
'>:' Operator |
| 170 |
'AT' Keyword.Type |
| 171 |
'{' Punctuation |
| 172 |
'T' Keyword.Type |
| 173 |
',' Punctuation |
| 174 |
'1' Literal.Number.Integer |
| 175 |
'}' Punctuation |
| 176 |
'\n' Text.Whitespace |
| 177 |
|
| 178 |
'A' Keyword.Type |
| 179 |
' ' Text.Whitespace |
| 180 |
'<:' Operator |
| 181 |
' ' Text.Whitespace |
| 182 |
'f' Name |
| 183 |
'(' Punctuation |
| 184 |
'B' Name |
| 185 |
')' Punctuation |
| 186 |
'\n' Text.Whitespace |
| 187 |
|
| 188 |
'g' Name |
| 189 |
'(' Punctuation |
| 190 |
'C' Name |
| 191 |
')' Punctuation |
| 192 |
' ' Text.Whitespace |
| 193 |
'<:' Operator |
| 194 |
' ' Text.Whitespace |
| 195 |
'T' Keyword.Type |
| 196 |
'\n' Text.Whitespace |