Skip to content

Commit aff92c5

Browse files
authored
Merge branch 'master' into pipe-include-module-two
2 parents 978811d + 97a81e5 commit aff92c5

File tree

548 files changed

+7607
-6713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

548 files changed

+7607
-6713
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -137,32 +137,32 @@ jobs:
137137
shell: bash
138138

139139
# matrix.ocaml_compiler may contain commas
140-
# - name: Get OPAM cache key
141-
# shell: bash
142-
# run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
140+
- name: Get OPAM cache key
141+
shell: bash
142+
run: echo "opam_cache_key=opam-env-v8-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam') }}" | sed 's/,/-/g' >> $GITHUB_ENV
143143

144-
# - name: Restore OPAM environment
145-
# id: cache-opam-env
146-
# uses: actions/cache/restore@v4
147-
# with:
148-
# path: |
149-
# ${{ runner.tool_cache }}/opam
150-
# ~/.opam
151-
# _opam
152-
# .opam-path
153-
# D:\cygwin
154-
# D:\.opam
155-
# key: ${{ env.opam_cache_key }}
144+
- name: Restore OPAM environment
145+
id: cache-opam-env
146+
uses: actions/cache/restore@v4
147+
with:
148+
path: |
149+
${{ runner.tool_cache }}/opam
150+
~/.opam
151+
_opam
152+
.opam-path
153+
D:\cygwin
154+
D:\.opam
155+
key: ${{ env.opam_cache_key }}
156156

157157
- name: Use OCaml ${{matrix.ocaml_compiler}}
158158
uses: ocaml/[email protected]
159-
# if: steps.cache-opam-env.outputs.cache-hit != 'true'
159+
if: steps.cache-opam-env.outputs.cache-hit != 'true'
160160
with:
161161
ocaml-compiler: ${{matrix.ocaml_compiler}}
162162
opam-pin: false
163163

164164
- name: Get OPAM executable path
165-
# if: steps.cache-opam-env.outputs.cache-hit != 'true'
165+
if: steps.cache-opam-env.outputs.cache-hit != 'true'
166166
uses: actions/github-script@v7
167167
with:
168168
script: |
@@ -174,63 +174,63 @@ jobs:
174174
console.log('stored path to .opam-path');
175175
176176
- name: Install OPAM dependencies
177-
# if: steps.cache-opam-env.outputs.cache-hit != 'true'
177+
if: steps.cache-opam-env.outputs.cache-hit != 'true'
178178
run: opam install . --deps-only --with-test
179179

180-
# - name: Cache OPAM environment
181-
# # if: steps.cache-opam-env.outputs.cache-hit != 'true'
182-
# uses: actions/cache/save@v4
183-
# with:
184-
# path: |
185-
# ${{ runner.tool_cache }}/opam
186-
# ~/.opam
187-
# _opam
188-
# .opam-path
189-
# D:\cygwin
190-
# D:\.opam
191-
# key: ${{ env.opam_cache_key }}
192-
193-
# - name: Use cached OPAM environment
194-
# if: steps.cache-opam-env.outputs.cache-hit == 'true'
195-
# run: |
196-
# # https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/installer.ts#L33
197-
# echo "OPAMVERBOSE=$RUNNER_DEBUG" >> "$GITHUB_ENV"
198-
# echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
199-
# echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
200-
# echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
201-
# echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
202-
# echo "OPAMYES=1" >> "$GITHUB_ENV"
203-
204-
# if [[ "$RUNNER_OS" != "Windows" ]]; then
205-
# echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
206-
# else
207-
# echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
208-
# fi
209-
210-
# OPAM_PATH="$(cat .opam-path)"
211-
# chmod +x "$OPAM_PATH"
212-
# dirname "$OPAM_PATH" >> "$GITHUB_PATH"
213-
214-
# if [[ "$RUNNER_OS" == "Windows" ]]; then
215-
# fsutil behavior query SymlinkEvaluation
216-
# fsutil behavior set symlinkEvaluation R2L:1 R2R:1
217-
# fsutil behavior query SymlinkEvaluation
218-
219-
# CYGWIN="winsymlinks:native"
220-
# CYGWIN_ROOT="D:\\cygwin"
221-
# CYGWIN_ROOT_BIN="D:\\cygwin\\bin"
222-
# CYGWIN_ROOT_WRAPPERBIN="D:\\cygwin\\wrapperbin"
223-
224-
# echo "HOME=$USERPROFILE" >> "$GITHUB_ENV"
225-
# echo "MSYS=winsymlinks:native" >> "$GITHUB_ENV"
226-
# echo "CYGWIN=$CYGWIN" >> "$GITHUB_ENV"
227-
# echo "CYGWIN_ROOT=$CYGWIN_ROOT" >> "$GITHUB_ENV"
228-
# echo "CYGWIN_ROOT_BIN=$CYGWIN_ROOT_BIN" >> "$GITHUB_ENV"
229-
# echo "CYGWIN_ROOT_WRAPPERBIN=$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_ENV"
230-
231-
# echo "$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_PATH"
232-
# fi
233-
# shell: bash
180+
- name: Cache OPAM environment
181+
if: steps.cache-opam-env.outputs.cache-hit != 'true'
182+
uses: actions/cache/save@v4
183+
with:
184+
path: |
185+
${{ runner.tool_cache }}/opam
186+
~/.opam
187+
_opam
188+
.opam-path
189+
D:\cygwin
190+
D:\.opam
191+
key: ${{ env.opam_cache_key }}
192+
193+
- name: Use cached OPAM environment
194+
if: steps.cache-opam-env.outputs.cache-hit == 'true'
195+
run: |
196+
# https://github.com/ocaml/setup-ocaml/blob/b2105f9/packages/setup-ocaml/src/installer.ts#L33
197+
echo "OPAMVERBOSE=$RUNNER_DEBUG" >> "$GITHUB_ENV"
198+
echo "OPAMCOLOR=always" >> "$GITHUB_ENV"
199+
echo "OPAMCONFIRMLEVEL=unsafe-yes" >> "$GITHUB_ENV"
200+
echo "OPAMERRLOGLEN=0" >> "$GITHUB_ENV"
201+
echo "OPAMPRECISETRACKING=1" >> "$GITHUB_ENV"
202+
echo "OPAMYES=1" >> "$GITHUB_ENV"
203+
204+
if [[ "$RUNNER_OS" != "Windows" ]]; then
205+
echo "OPAMROOT=$HOME/.opam" >> "$GITHUB_ENV"
206+
else
207+
echo "OPAMROOT=D:\\.opam" >> "$GITHUB_ENV"
208+
fi
209+
210+
OPAM_PATH="$(cat .opam-path)"
211+
chmod +x "$OPAM_PATH"
212+
dirname "$OPAM_PATH" >> "$GITHUB_PATH"
213+
214+
if [[ "$RUNNER_OS" == "Windows" ]]; then
215+
fsutil behavior query SymlinkEvaluation
216+
fsutil behavior set symlinkEvaluation R2L:1 R2R:1
217+
fsutil behavior query SymlinkEvaluation
218+
219+
CYGWIN="winsymlinks:native"
220+
CYGWIN_ROOT="D:\\cygwin"
221+
CYGWIN_ROOT_BIN="D:\\cygwin\\bin"
222+
CYGWIN_ROOT_WRAPPERBIN="D:\\cygwin\\wrapperbin"
223+
224+
echo "HOME=$USERPROFILE" >> "$GITHUB_ENV"
225+
echo "MSYS=winsymlinks:native" >> "$GITHUB_ENV"
226+
echo "CYGWIN=$CYGWIN" >> "$GITHUB_ENV"
227+
echo "CYGWIN_ROOT=$CYGWIN_ROOT" >> "$GITHUB_ENV"
228+
echo "CYGWIN_ROOT_BIN=$CYGWIN_ROOT_BIN" >> "$GITHUB_ENV"
229+
echo "CYGWIN_ROOT_WRAPPERBIN=$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_ENV"
230+
231+
echo "$CYGWIN_ROOT_WRAPPERBIN" >> "$GITHUB_PATH"
232+
fi
233+
shell: bash
234234

235235
- name: Compiler build state key
236236
id: compiler-build-state-key

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,24 @@
1717
- Add `RegExp.flags`. https://github.com/rescript-lang/rescript/pull/7461
1818
- Add `Array.findLast`, `Array.findLastWithIndex`, `Array.findLastIndex`, `Array.findLastIndexWithIndex` and `Array.findLastIndexOpt`. https://github.com/rescript-lang/rescript/pull/7503
1919
- Add `options` argument to `Console.dir`. https://github.com/rescript-lang/rescript/pull/7504
20+
- Show variant constructor's inline record types on hover. https://github.com/rescript-lang/rescript/pull/7519
2021

2122
#### :bug: Bug fix
2223

2324
- `rescript-tools doc` no longer includes shadowed bindings in its output. https://github.com/rescript-lang/rescript/pull/7497
25+
- Treat `throw` like `raise` in analysis. https://github.com/rescript-lang/rescript/pull/7521
26+
- Fix `index out of bounds` exception thrown in rare cases by `rescript-editor-analysis.exe codeAction` command. https://github.com/rescript-lang/rescript/pull/7523
2427

2528
#### :nail_care: Polish
2629

2730
- Suggest awaiting promise before using it when types mismatch. https://github.com/rescript-lang/rescript/pull/7498
2831
- Complete from `RegExp` stdlib module for regexes. https://github.com/rescript-lang/rescript/pull/7425
2932
- Allow oneliner formatting when including module with single type alias. https://github.com/rescript-lang/rescript/pull/7502
3033
- Improve error messages for JSX type mismatches, passing objects where record is expected, passing array literal where tuple is expected, and more. https://github.com/rescript-lang/rescript/pull/7500
34+
- Show in error messages when coercion can be used to fix a type mismatch. https://github.com/rescript-lang/rescript/pull/7505
35+
- Remove deprecated pipe last (`|>`) syntax. https://github.com/rescript-lang/rescript/pull/7512
36+
- Improve error message for pipe (`->`) syntax. https://github.com/rescript-lang/rescript/pull/7520
37+
- Improve a few error messages around various subtyping issues. https://github.com/rescript-lang/rescript/pull/7404
3138
- Editor: add completions from included modules. https://github.com/rescript-lang/rescript/pull/7515
3239

3340
# 12.0.0-alpha.13

analysis/examples/larger-project/src/arg_helper.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,27 @@ module Make = (
7676
| exception Not_found =>
7777
switch S.Value.of_string(value) {
7878
| value => set_user_default(value, acc)
79-
| exception exn => raise(Parse_failure(exn))
79+
| exception exn => throw(Parse_failure(exn))
8080
}
8181
| equals =>
8282
let key_value_pair = value
8383
let length = String.length(key_value_pair)
8484
assert (equals >= 0 && equals < length)
8585
if equals == 0 {
86-
raise(Parse_failure(Failure("Missing key in argument specification")))
86+
throw(Parse_failure(Failure("Missing key in argument specification")))
8787
}
8888
let key = {
8989
let key = String.sub(key_value_pair, 0, equals)
9090
try S.Key.of_string(key) catch {
91-
| exn => raise(Parse_failure(exn))
91+
| exn => throw(Parse_failure(exn))
9292
}
9393
}
9494

9595
let value = {
9696
let value = String.sub(key_value_pair, equals + 1, length - equals - 1)
9797

9898
try S.Value.of_string(value) catch {
99-
| exn => raise(Parse_failure(exn))
99+
| exn => throw(Parse_failure(exn))
100100
}
101101
}
102102

analysis/examples/larger-project/src/ast_helper.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let with_default_loc = (l, f) => {
4747
} catch {
4848
| exn =>
4949
default_loc := old
50-
raise(exn)
50+
throw(exn)
5151
}
5252
}
5353

@@ -94,7 +94,7 @@ module Typ = {
9494
@raises(Error)
9595
let check_variable = (vl, loc, v) =>
9696
if List.mem(v, vl) {
97-
raise({
97+
throw({
9898
open Syntaxerr
9999
Error(Variable_in_scope(loc, v))
100100
})
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@raise(DecodeError)
1+
@throw(DecodeError)
22
let testBsJson = x => Json_decode.string(x)
33

4-
@raise(DecodeError)
4+
@throw(DecodeError)
55
let testBsJson2 = x => Json.Decode.string(x)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@raises(Not_found)
2-
let foo = () => raise(Not_found)
2+
let foo = () => throw(Not_found)

analysis/examples/larger-project/src/exception/Yojson.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ module Basic = {
44
type t
55

66
@raises(Json_error)
7-
let from_string: string => t = _ => raise(Json_error("Basic.from_string"))
7+
let from_string: string => t = _ => throw(Json_error("Basic.from_string"))
88

99
module Util = {
1010
exception Type_error(string, t)
1111

1212
@raises(Type_error)
13-
let member: (string, t) => t = (_s, j) => raise(Type_error("Basic.Util.member", j))
13+
let member: (string, t) => t = (_s, j) => throw(Type_error("Basic.Util.member", j))
1414

1515
let to_int: t => int = _ => 34
1616

analysis/examples/larger-project/src/location.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,5 +257,5 @@ let () = register_error_of_exn(x =>
257257
@raises(Error)
258258
let raise_errorf = (~loc=none, ~sub=list{}, ~if_highlight="") =>
259259
pp_ksprintf(~before=print_phanton_error_prefix, msg =>
260-
raise(Error({loc: loc, msg: msg, sub: sub, if_highlight: if_highlight}))
260+
throw(Error({loc: loc, msg: msg, sub: sub, if_highlight: if_highlight}))
261261
)

0 commit comments

Comments
 (0)