Skip to content

Commit 7e8de75

Browse files
committed
chore: sync version to 0.0.39 and add changelog entry
- Update version.json compiler version to 0.0.39 - Add changelog entry for type inference engine (en/ko/ja) - Document: BodyParser, TypeEnv, ASTTypeInferrer - Document: literal inference, method call tracking, implicit returns
1 parent e114777 commit 7e8de75

File tree

4 files changed

+110
-1
lines changed

4 files changed

+110
-1
lines changed

docs/project/changelog.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ All notable changes to T-Ruby will be documented in this file.
1414
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1515
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1616

17+
## [0.0.39] - 2025-12-24
18+
19+
### Added
20+
21+
#### Type Inference Engine
22+
- **TypeScript-style type inference** - Automatic return type inference without explicit annotations
23+
- **BodyParser** - New parser for method body IR node generation
24+
- **TypeEnv** - Scope chain management for variable type tracking
25+
- **ASTTypeInferrer** - Expression type inference with lazy evaluation and caching
26+
- **Literal inference** - `"hello"``String`, `42``Integer`, `true``bool`
27+
- **Method call tracking** - `str.upcase``String`, `arr.length``Integer`
28+
- **Implicit return handling** - Ruby's last expression as return type
29+
- **Conditional type inference** - Union types from `if`/`else` branches
30+
- **200+ built-in method types** - Common Ruby method return types
31+
32+
#### Special Handling
33+
- **`initialize` method** - Always returns `void` (RBS convention)
34+
- **Unreachable code detection** - Ignores code after unconditional `return`
35+
36+
### Example
37+
38+
Before (explicit annotation required):
39+
```ruby
40+
def greet(name: String): String
41+
"Hello, #{name}!"
42+
end
43+
```
44+
45+
After (inference works automatically):
46+
```ruby
47+
def greet(name: String)
48+
"Hello, #{name}!"
49+
end
50+
# RBS: def greet: (name: String) -> String
51+
```
52+
1753
## [Unreleased]
1854
1955
### Planned
@@ -275,6 +311,7 @@ T-Ruby is released under the MIT License. See LICENSE file for details.
275311

276312
| Version | Release Date | Status | Highlights |
277313
|---------|--------------|--------|------------|
314+
| [0.0.39](#0039---2025-12-24) | 2025-12-24 | Alpha | TypeScript-style type inference |
278315
| [0.1.0-alpha](#010-alpha---2025-12-09) | 2025-12-09 | Alpha | Initial release, core features |
279316
| 0.2.0 | TBD | Planned | LSP, tuples, tooling |
280317
| 0.3.0 | TBD | Planned | Rails types, advanced features |

i18n/ja/docusaurus-plugin-content-docs/current/project/changelog.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ T-Rubyのすべての注目すべき変更はこのファイルに文書化さ
1414
形式は[Keep a Changelog](https://keepachangelog.com/en/1.0.0/)に基づいており、
1515
このプロジェクトは[セマンティックバージョニング](https://semver.org/spec/v2.0.0.html)に従います。
1616

17+
## [0.0.39] - 2025-12-24
18+
19+
### 追加
20+
21+
#### 型推論エンジン
22+
- **TypeScriptスタイル型推論** - 明示的なアノテーションなしで自動的に戻り値の型を推論
23+
- **BodyParser** - メソッド本体のIRノード生成用の新しいパーサー
24+
- **TypeEnv** - 変数型追跡のためのスコープチェーン管理
25+
- **ASTTypeInferrer** - 遅延評価とキャッシングによる式の型推論
26+
- **リテラル推論** - `"hello"``String``42``Integer``true``bool`
27+
- **メソッド呼び出し追跡** - `str.upcase``String``arr.length``Integer`
28+
- **暗黙的な戻り値の処理** - Rubyの最後の式を戻り値の型として
29+
- **条件文の型推論** - `if`/`else`分岐からのユニオン型
30+
- **200以上の組み込みメソッド型** - 一般的なRubyメソッドの戻り値型
31+
32+
#### 特別な処理
33+
- **`initialize`メソッド** - 常に`void`を返す(RBSの慣例)
34+
- **到達不能コードの検出** - 無条件`return`後のコードを無視
35+
36+
###
37+
38+
以前(明示的なアノテーションが必要):
39+
```ruby
40+
def greet(name: String): String
41+
"Hello, #{name}!"
42+
end
43+
```
44+
45+
以後(推論が自動的に動作):
46+
```ruby
47+
def greet(name: String)
48+
"Hello, #{name}!"
49+
end
50+
# RBS: def greet: (name: String) -> String
51+
```
52+
1753
## [未リリース]
1854
1955
### 計画中

i18n/ko/docusaurus-plugin-content-docs/current/project/changelog.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,42 @@ T-Ruby의 모든 주목할 만한 변경 사항은 이 파일에 문서화됩니
1414
형식은 [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)를 기반으로 하며,
1515
이 프로젝트는 [시맨틱 버저닝](https://semver.org/spec/v2.0.0.html)을 따릅니다.
1616

17+
## [0.0.39] - 2025-12-24
18+
19+
### 추가됨
20+
21+
#### 타입 추론 엔진
22+
- **TypeScript 스타일 타입 추론** - 명시적 어노테이션 없이 자동 반환 타입 추론
23+
- **BodyParser** - 메서드 본문 IR 노드 생성을 위한 새 파서
24+
- **TypeEnv** - 변수 타입 추적을 위한 스코프 체인 관리
25+
- **ASTTypeInferrer** - 지연 평가와 캐싱을 사용한 표현식 타입 추론
26+
- **리터럴 추론** - `"hello"``String`, `42``Integer`, `true``bool`
27+
- **메서드 호출 추적** - `str.upcase``String`, `arr.length``Integer`
28+
- **암묵적 반환 처리** - Ruby의 마지막 표현식을 반환 타입으로
29+
- **조건문 타입 추론** - `if`/`else` 분기에서 유니온 타입
30+
- **200개 이상의 내장 메서드 타입** - 일반적인 Ruby 메서드 반환 타입
31+
32+
#### 특별 처리
33+
- **`initialize` 메서드** - 항상 `void` 반환 (RBS 규칙)
34+
- **도달 불가능 코드 감지** - 무조건적 `return` 이후 코드 무시
35+
36+
### 예제
37+
38+
이전 (명시적 어노테이션 필요):
39+
```ruby
40+
def greet(name: String): String
41+
"Hello, #{name}!"
42+
end
43+
```
44+
45+
이후 (추론이 자동으로 동작):
46+
```ruby
47+
def greet(name: String)
48+
"Hello, #{name}!"
49+
end
50+
# RBS: def greet: (name: String) -> String
51+
```
52+
1753
## [미공개]
1854
1955
### 계획됨

static/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"compiler": "0.0.38",
2+
"compiler": "0.0.39",
33
"vscode": "0.2.0",
44
"jetbrains": "0.1.2",
55
"wasm": "0.0.8"

0 commit comments

Comments
 (0)