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

Allow types to be referred to through by projection #192

Closed
Marwes opened this issue Oct 22, 2016 · 0 comments
Closed

Allow types to be referred to through by projection #192

Marwes opened this issue Oct 22, 2016 · 0 comments

Comments

@Marwes
Copy link
Member

Marwes commented Oct 22, 2016

Allow something like this to be written

let prelude = import "std/prelude.glu"
let x : prelude.Option Int = ...
x

Instead of

let { Option} = import "std/prelude.glu"
let x : Option Int = ...
x
@Marwes Marwes added this to the 1.0.0 milestone Sep 15, 2017
Marwes added a commit to Marwes/gluon that referenced this issue Nov 2, 2017
Since we want to provide the correct spans in the errors I had to hook into the ast type translation which was slightly awkward (need to clone `type_cache` to make lifetimes work).

## Example

```f#
type Test = Int
let module = { Test }
let x : module.Test = 1
x
```

Closes gluon-lang#192

Fixes gluon-lang#370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant