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

implement std/wrapnils without using experimental:dotOperators #16996

Merged
merged 1 commit into from
Feb 10, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Feb 10, 2021

avoids issues like #13063 for modules importing std/wrapnils.

when true:
  import std/wrapnils
  type Foo = object
  discard Foo().nonexistant

before PR

t11843.nim(25, 16) Error: type mismatch: got <Foo>
but expected one of:
template `.`(a: Wrapnil; b): untyped [template declared in /Users/timothee/git_clone/nim/Nim_devel/lib/std/wrapnils.nim(44, 10)]
  first type mismatch at position: 1
  required type for a: Wrapnil [compositeTypeClass declared in /Users/timothee/git_clone/nim/Nim_devel/lib/std/wrapnils.nim(44, 15)]
  but expression 'Foo()' is of type: Foo [object declared in t11843.nim(24, 8)]

after PR

t11843.nim(25, 16) Error: undeclared field: 'nonexistant' for type t11843.Foo [type declared in t11843.nim(24, 8)]
    discard Foo().nonexistant

note

experimental:dotOperators still has it's use, the fate of experimental:dotOperators is out of scope for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants