~mna/snow

2f3d3e42836f344cb03173f310d1228d621cc024 — Martin Angers 1 year, 8 months ago 56c35e0
pkg/codegen: almost all tests pass, except the one complex generic
M pkg/codegen/testdata/fn_generic_decl_after_inst.snow.want => pkg/codegen/testdata/fn_generic_decl_after_inst.snow.want +5 -5
@@ 2,17 2,17 @@ package main

import "fmt"

func main() {
	var a int = _اAا0(1)
	_اprintln(a)
}

func _اAا0(
	v int,
) int {
	return v
}

func main() {
	var a int = _اAا0(1)
	_اprintln(a)
}

func _اprintln(
	i int,
) {

M pkg/codegen/testdata/fn_generic_fn_uses_generic_fn.snow.want => pkg/codegen/testdata/fn_generic_fn_uses_generic_fn.snow.want +6 -6
@@ 2,6 2,12 @@ package main

import "fmt"

func _اAا0(
	v int,
) int {
	return v
}

func _اBا0(
	x int,
) int {


@@ 11,12 17,6 @@ func _اBا0(
	return a(x)
}

func _اAا0(
	v int,
) int {
	return v
}

func main() {
	var b int = _اBا0(1)
	_اprintln(b)

M pkg/codegen/testdata/fn_nested_struct_method.snow.want => pkg/codegen/testdata/fn_nested_struct_method.snow.want +8 -8
@@ 2,12 2,20 @@ package main

import "fmt"

type _ا4اS struct {
	_اx string
}

func (
	self *_ا4اS,
) _اinit() {
	self._اx = "hello"
}

type _ا5اT struct {
	_اy string
}

func (
	self *_ا5اT,
) _اappend(


@@ 16,10 24,6 @@ func (
	self._اy = self._اy + s
}

type _ا5اT struct {
	_اy string
}

func _ا5اTاnew(
	s _ا5اT,
	m map[string]bool,


@@ 31,10 35,6 @@ func _ا5اTاnew(
	return r
}

type _ا4اS struct {
	_اx string
}

func _ا4اSاnew(
	s _ا4اS,
	m map[string]bool,

M pkg/codegen/testdata/fn_return_nested_tuple_reconcile.snow.want => pkg/codegen/testdata/fn_return_nested_tuple_reconcile.snow.want +21 -21
@@ 41,6 41,27 @@ func _ااconvert_0(
	}{from._ا0, _ااconvert_1(from._ا1)}
}

func _اget_tuple(
	x struct {
		_ا0 int8
		_ا1 string
	},
) struct {
	_ا0 bool
	_ا1 struct {
		_ا0 int16
		_ا1 string
	}
} {
	return _ااconvert_0(struct {
		_ا0 bool
		_ا1 struct {
			_ا0 int8
			_ا1 string
		}
	}{true, x})
}

func _ااconvert_3(
	from struct {
		_ا0 int16


@@ 119,27 140,6 @@ func _ااconvert_4(
	}{from._ا0, _ااconvert_5(from._ا1)}
}

func _اget_tuple(
	x struct {
		_ا0 int8
		_ا1 string
	},
) struct {
	_ا0 bool
	_ا1 struct {
		_ا0 int16
		_ا1 string
	}
} {
	return _ااconvert_0(struct {
		_ا0 bool
		_ا1 struct {
			_ا0 int8
			_ا1 string
		}
	}{true, x})
}

func main() {
	var i int8
	var t struct {

M pkg/codegen/testdata/fn_struct_method.snow.want => pkg/codegen/testdata/fn_struct_method.snow.want +10 -10
@@ 2,6 2,16 @@ package main

import "fmt"

func _اprintln(
	x int,
) {
	fmt.Println(x)
}

type _ا5اS struct {
	_اx int
}

func (
	self *_ا5اS,
) _اinc() {


@@ 14,10 24,6 @@ func (
	self._اx = self._اx + 1
}

type _ا5اS struct {
	_اx int
}

func _ا5اSاnew(
	s _ا5اS,
	m map[string]bool,


@@ 29,12 35,6 @@ func _ا5اSاnew(
	return r
}

func _اprintln(
	x int,
) {
	fmt.Println(x)
}

func main() {
	var s _ا5اS
	s._اx = 3