Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Generic error "got T, expected T" #905

Closed
svermeulen opened this issue Jan 13, 2025 · 1 comment
Closed

Regression: Generic error "got T, expected T" #905

svermeulen opened this issue Jan 13, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@svermeulen
Copy link
Contributor

Hard to explain this one. I tried reducing it down as much as possible.

The following compiles fine for previous versions of teal. For current version (master) we get error main.tl:11:26: argument 1: argument 1: got T, expected T:

local record Mapper<T1>
   map:function<T2>(self, selector:(function(T1):T2))
end

local function to_mapper<T>(_values:{T}):Mapper<T>
   error("unimplemented")
end

local function _run<T>(values:{T})
   to_mapper(values):map(function(_:T):integer return 5 end)
end

_run({
   "five"
})
@hishamhm hishamhm added the bug Something isn't working label Jan 13, 2025
hishamhm added a commit that referenced this issue Jan 13, 2025
@svermeulen
Copy link
Contributor Author

Can confirm that #906 fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants