forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix semFinishOperand for bracket expressions
fixes nim-lang#23568, fixes nim-lang#23310
- Loading branch information
Showing
2 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
block: # issue #23568 | ||
type G[T] = object | ||
j: T | ||
proc s[T](u: int) = discard | ||
proc s[T]() = discard | ||
proc c(e: int | int): G[G[G[int]]] = s[G[G[int]]]() | ||
discard c(0) | ||
|
||
import std/options | ||
|
||
block: # issue #23310 | ||
type | ||
BID = string or uint64 | ||
Future[T] = ref object of RootObj | ||
internalValue: T | ||
InternalRaisesFuture[T] = ref object of Future[T] | ||
proc newInternalRaisesFutureImpl[T](): InternalRaisesFuture[T] = | ||
let fut = InternalRaisesFuture[T]() | ||
template newFuture[T](): auto = | ||
newInternalRaisesFutureImpl[T]() | ||
proc problematic(blockId: BID): Future[Option[seq[int]]] = | ||
let resultFuture = newFuture[Option[seq[int]]]() | ||
return resultFuture | ||
let x = problematic("latest") |